# Something went wrong while updating the cache of APT (due to SURY) (version 2024)

**URL:** https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570
**Category:** Support
**Tags:** french
**Created:** [February 16, 2024, 11:21am UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570 "2024-02-16T11:21:24Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Mamie](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mamie/32/1245_2.png) [@Mamie](https://forum.yunohost.org/u/Mamie)
#### Post date: [February 16, 2024, 11:21am UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/1 "2024-02-16T11:21:24Z")

</div>

## 🇬🇧/🇺🇸 What to do if you have an error while updating the repo ?

I just had an error while trying to update my server :

```Something
[multiple sources listed here]
W: Some index files failed to download. They have been ignored, or old ones used instead.

W: Failed to fetch https://packages.sury.org/php/dists/bullseye/InRelease The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.sury.org/php buster InRelease: The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key 

```

I then found this issue in the sury bug tracker : [Apt key for Debian Package is expiring on 16.02.2024 · Issue #2074 · oerdnj/deb.sury.org · GitHub](https://github.com/oerdnj/deb.sury.org/issues/2074)  
No nice 1 liner to fix this, but I create this topic just because I can not bump the one created 2 years ago, with a solution : [Something went wrong while updating the cache of APT (due to SURY)](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury/15024)  
`apt-key del 95BD4743; wget -nv -O - "https://packages.sury.org/php/apt.gpg" | apt-key add -`  
(On my server, I had to run this adaptation : `sudo apt-key del 95BD4743; wget -nv -O - "https://packages.sury.org/php/apt.gpg" | sudo apt-key add -`

Hopping it will help 😃

PS : It seems that a better solution is on it’s way, but only maybe for next time, see you in 2 years.

* * *

## 🇫🇷Que faire en cas d’erreur lors de l’update des paquets ?

Je viens d’avoir cette erreur en essayant de mettre à jour mon serveur :

```Something
[plusieurs fichier source listés ici]
W: Some index files failed to download. They have been ignored, or old ones used instead.

W: Failed to fetch https://packages.sury.org/php/dists/bullseye/InRelease The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.sury.org/php buster InRelease: The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key 

```

J’ai ensuite trouvé ce ticket sur le bug tracker de sury : [Apt key for Debian Package is expiring on 16.02.2024 · Issue #2074 · oerdnj/deb.sury.org · GitHub](https://github.com/oerdnj/deb.sury.org/issues/2074)  
Mais pas de joli fix en une ligne comme il y a 2 ans, mais ce topic a ce qu’il faut : [Something went wrong while updating the cache of APT (due to SURY)](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury/15024)  
`apt-key del 95BD4743; wget -nv -O - "https://packages.sury.org/php/apt.gpg" | apt-key add -`  
(Sur mon serveur j’ai du l’exécuter comme ça : `sudo apt-key del 95BD4743; wget -nv -O - "https://packages.sury.org/php/apt.gpg" | sudo apt-key add -`

En espérant que ça aide 😃

PS : Il semblerait qu’une solution plus propre soit en cours, mais ça ne sera peut-être disponible que la prochaine fois, à dans 2 ans !

---

<div class="post-metadata">

### Author: ![Mamie](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mamie/32/1245_2.png) [@Mamie](https://forum.yunohost.org/u/Mamie)
#### Post date: [February 16, 2024, 11:21am UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/2 "2024-02-16T11:21:51Z")

</div>

Empty post to mark it solved.

---

<div class="post-metadata">

### Author: ![crustyourmind](https://forum.yunohost.org/user_avatar/forum.yunohost.org/crustyourmind/32/2197_2.png) [@crustyourmind](https://forum.yunohost.org/u/crustyourmind)
#### Post date: [February 17, 2024, 9:28am UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/3 "2024-02-17T09:28:55Z")

</div>

> [@Mamie](#):
>
> sudo apt-key del 95BD4743; wget -nv -O - “[https://packages.sury.org/php/apt.gpg](https://packages.sury.org/php/apt.gpg)” | sudo apt-key add -

Nice works fine 😉 Thx

---

<div class="post-metadata">

### Author: ![OniriCorpe](https://forum.yunohost.org/user_avatar/forum.yunohost.org/oniricorpe/32/3356_2.png) [@OniriCorpe](https://forum.yunohost.org/u/OniriCorpe)
#### Post date: [February 17, 2024, 5:58pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/4 "2024-02-17T17:58:15Z")

</div>



---

<div class="post-metadata">

### Author: ![ImaCrea](https://forum.yunohost.org/user_avatar/forum.yunohost.org/imacrea/32/2089_2.png) [@ImaCrea](https://forum.yunohost.org/u/ImaCrea)
#### Post date: [February 18, 2024, 5:35pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/5 "2024-02-18T17:35:48Z")

</div>

Ça marche, merci @Mamie !

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [February 18, 2024, 7:40pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/6 "2024-02-18T19:40:56Z")

</div>

This can also be done by force-regenerating the configuration:

```sh
$ sudo yunohost tools regen-conf -f

```

The upcoming way as per [sury’s github page](https://github.com/oerdnj/deb.sury.org/issues/2074) is to use `debsuryorg-archive-keyring` package, can’t say for sure but I suspect this’ll be incorporated as YNH’s DEB requirement in the future (if it’s not already).

---

<div class="post-metadata">

### Author: ![olivierd](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/o/ac8455/32.png) [@olivierd](https://forum.yunohost.org/u/olivierd)
#### Post date: [February 19, 2024, 11:28am UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/7 "2024-02-19T11:28:37Z")

</div>

Bonjour,  
Déjà, la commande apt-key est rejetée, signalée comme “deprecied” sur mon système  
J’ai excuté la commande indiquée par orhtej2 qui m’a permis de faire mon update et mon update en intégrant les depots sury.  
Mais j’ai maintenant un nouveau souci, je reçoit toutes les 10mn le message suivant

> Aucun domaine n’a été enregistré avec DynDNS

Merci d’avance pour vos préconisations

---

<div class="post-metadata">

### Author: ![Dex](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/d/5e9695/32.png) [@Dex](https://forum.yunohost.org/u/Dex)
#### Post date: [February 19, 2024, 4:13pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/8 "2024-02-19T16:13:51Z")

</div>

I’m getting a similar error with slight differences to the packages trying to be reached: [log here](https://paste.yunohost.org/raw/opaqawafej)

I’ve tried both the stated solutions:

```auto
sudo apt-key del 95BD4743; wget -nv -O - "https://packages.sury.org/php/apt.gpg" | sudo apt-key add -

```

Which gave me this message:

```auto
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
“https://packages.sury.org/php/apt.gpg”: Scheme missing.
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
gpg: no valid OpenPGP data found.

```

I then tried

```auto
sudo yunohost tools regen-conf -f

```

I tried to update my server again and got the same errors, I then tried rebooting the server and running the update again with the same errors.

Any guidance much appreciated!

---

<div class="post-metadata">

### Author: ![Mamie](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mamie/32/1245_2.png) [@Mamie](https://forum.yunohost.org/u/Mamie)
#### Post date: [February 21, 2024, 8:13am UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/9 "2024-02-21T08:13:42Z")

</div>

It seems that YunoHost 11.2.10.1 contains a fix for this.

---

<div class="post-metadata">

### Author: ![ceciliyazi](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@ceciliyazi](https://forum.yunohost.org/u/ceciliyazi)
#### Post date: [February 22, 2024, 1:31pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/10 "2024-02-22T13:31:35Z")

</div>

same. I tried both and received the same erros…

---

<div class="post-metadata">

### Author: ![OniriCorpe](https://forum.yunohost.org/user_avatar/forum.yunohost.org/oniricorpe/32/3356_2.png) [@OniriCorpe](https://forum.yunohost.org/u/OniriCorpe)
#### Post date: [February 22, 2024, 2:31pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/11 "2024-02-22T14:31:05Z")

</div>

> [@Mamie](#):
>
> It seems that YunoHost 11.2.10.1 contains a fix for this.

yes, starting with YunoHost 11.2.10.1, `yunohost tools regen-conf` is clearing the APT keys  
see: [Update sury apt key by Tagadda · Pull Request #1777 · YunoHost/yunohost · GitHub](https://github.com/YunoHost/yunohost/pull/1777/files)

---

<div class="post-metadata">

### Author: ![Dex](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/d/5e9695/32.png) [@Dex](https://forum.yunohost.org/u/Dex)
#### Post date: [March 7, 2024, 2:21pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/12 "2024-03-07T14:21:57Z")

</div>

Running `sudo yunohost tools regen-conf -f` again worked this time.

---

<div class="post-metadata">

### Author: ![arkadi](https://forum.yunohost.org/user_avatar/forum.yunohost.org/arkadi/32/5350_2.png) [@arkadi](https://forum.yunohost.org/u/arkadi)
#### Post date: [February 7, 2026, 12:18am UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/14 "2026-02-07T00:18:15Z")

</div>

I had similar problems with sury and yarn today.

I ran this command and it fixed all my GPG problems.  
`sudo yunohost tools regen-conf apt --force`

maybe better if people don’t want to touch other parts of their configuration.

---

<div class="post-metadata">

### Author: ![uw3](https://forum.yunohost.org/user_avatar/forum.yunohost.org/uw3/32/3871_2.png) [@uw3](https://forum.yunohost.org/u/uw3)
#### Post date: [February 7, 2026, 3:34pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/15 "2026-02-07T15:34:48Z")

</div>

I ran the same command and it updated the keys, but sury still fails:

Fehl:5 [https://packages.sury.org/php](https://packages.sury.org/php) bookworm InRelease  
Die folgenden Signaturen waren ungültig: EXPKEYSIG B188E2B695BD4743 [DEB.SURY.ORG](http://DEB.SURY.ORG) Automatic Signing Key [deb@sury.org](mailto:deb@sury.org)

Is there a specific command to update this key manually?

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [February 7, 2026, 8:24pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/16 "2026-02-07T20:24:31Z")

</div>

Given conf-regen hooks check if the key exists and, if yes, skip redownloading:

`sudo rm /etc/apt/trusted.gpg.d/extra_php_version.gpg`, then `sudo yunohost tools regen-conf apt --force`

Alternatively just fetch the current key (adopted from [core scripts](https://github.com/YunoHost/yunohost/blob/7b2fa212be08df9771f4f8ca9ff3e11a0e4e2614/hooks/conf_regen/10-apt#L102C36-L102C160):

```auto
curl -sL "https://packages.sury.org/php/apt.gpg" | gpg --dearmor | sudo tee "/etc/apt/trusted.gpg.d/extra_php_version.gpg" > /dev/null

```

---

<div class="post-metadata">

### Author: ![uw3](https://forum.yunohost.org/user_avatar/forum.yunohost.org/uw3/32/3871_2.png) [@uw3](https://forum.yunohost.org/u/uw3)
#### Post date: [February 7, 2026, 9:30pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/17 "2026-02-07T21:30:04Z")

</div>

Thanks, mate. I used the curl variant, because this approach also had fixed yarn for me.

---

<div class="post-metadata">

### Author: ![Iammee](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/i/a8b319/32.png) [@Iammee](https://forum.yunohost.org/u/Iammee)
#### Post date: [February 7, 2026, 9:43pm UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/18 "2026-02-07T21:43:11Z")

</div>

> Alternatively just fetch the current key (adopted from [core scripts](https://github.com/YunoHost/yunohost/blob/7b2fa212be08df9771f4f8ca9ff3e11a0e4e2614/hooks/conf_regen/10-apt#L102C36-L102C160):
> 
> ```auto
> curl -sL "https://packages.sury.org/php/apt.gpg" | gpg --dearmor | sudo tee "/etc/apt/trusted.gpg.d/extra_php_version.gpg" > /dev/null
> 
> ```

This worked for me! Thanks

---

<div class="post-metadata">

### Author: ![Paradroyd](https://forum.yunohost.org/user_avatar/forum.yunohost.org/paradroyd/32/11324_2.png) [@Paradroyd](https://forum.yunohost.org/u/Paradroyd)
#### Post date: [February 8, 2026, 3:55am UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/19 "2026-02-08T03:55:33Z")

</div>

> [@orhtej2](#):
>
> `curl -sL "https://packages.sury.org/php/apt.gpg" | gpg --dearmor | sudo tee "/etc/apt/trusted.gpg.d/extra_php_version.gpg" > /dev/null`

I have a slightly different problem, but it seems related. If I need to I can start a new topic. Here’s what I’m getting when I attempt to update.

```auto
~$ sudo apt update && sudo apt upgrade -y
Get:1 https://dl.yarnpkg.com/debian stable InRelease
Get:2 https://pkgs.tailscale.com/stable/debian bookworm InRelease                                                                                            
Hit:3 http://ftp.debian.org/debian bookworm InRelease                                                                                       
Hit:4 http://security.debian.org/debian-security bookworm-security InRelease                                          
Err:1 https://dl.yarnpkg.com/debian stable InRelease                                            
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 62D54FD4003F6525
Hit:6 http://ftp.debian.org/debian bookworm-updates InRelease                                   
Hit:7 https://packages.sury.org/php bookworm InRelease                                          
Err:7 https://packages.sury.org/php bookworm InRelease                   
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
Hit:5 https://forge.yunohost.org/debian bookworm InRelease
Reading package lists... Done
W: GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 62D54FD4003F6525
E: The repository 'https://dl.yarnpkg.com/debian stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.sury.org/php bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743

The listed solutions haven't worked for me.

```

---

<div class="post-metadata">

### Author: ![otm33](https://forum.yunohost.org/user_avatar/forum.yunohost.org/otm33/32/11941_2.png) [@otm33](https://forum.yunohost.org/u/otm33)
#### Post date: [February 8, 2026, 10:05am UTC](https://forum.yunohost.org/t/something-went-wrong-while-updating-the-cache-of-apt-due-to-sury-version-2024/28570/20 "2026-02-08T10:05:28Z")

</div>

See : [Yarn repo key expired [EDIT: changed again], is it OK to trust it?](https://forum.yunohost.org/t/yarn-repo-key-expired-edit-changed-again-is-it-ok-to-trust-it/41380)
