Yarn and Sury APT keys issues

Hi everyone !

You might have issues with your system updates :wrench:. Here are the usual error messages:

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 were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key
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.

Don’t panic ! There is an easy fix. You’ll just need a shell access (e.g via `ssh`) to your server.

Once you are logged in as admin, run:

sudo rm /etc/apt/trusted.gpg.d/{yarn,extra_php_version}.gpg
sudo yunohost tools regen-conf apt

And that’s all ! :tada:

To check that the fix is working, re-run the search of updates:

sudo apt update

We’ll try to find an automatic fix for the future but that’s not the easiest thing.

It seems it’s official to do that :

apt-get install extrepo
extrepo enable sury

In the absence of an autofix, would it be possible to add a diagnostic tool?
With the link to the thread :slight_smile:

Je ne suis pas sûr que cela fasse bon ménage avec un sudo yunohost tools regen-conf apt : il va y avoir deux clés (différentes a priori) pour un seul dépôt. Cela va poser problème.

I think this will cause a key mismatch when the sudo yunohost tools regen-conf apt command will be run : two (different, I guess) keys for a single repo : there will be an issue IMHO.

Super merci pour l’aide.
C’est résolu
Bon we

Merci beaucoup pour la solution!