You are currently viewing How to Fix Ubuntu Apt Update GPG Errors?
Ubuntu 22.04 LTS apt update GPG Errors

How to Fix Ubuntu Apt Update GPG Errors?

et’s imagine, you just upgraded to Ubuntu 22.04 LTS or Ubuntu 24.04 and ran apt update, first time, since upgrade. However, Following or similar errors pop up on screen. No problem! we have a solution for these Ubuntu 22.04 or Ubuntu apt update GPG error. This error can also occur in other release of Ubuntu including latest Ubuntu 24.04:

1. Error during signature verification
2. GPG Error: Public key is not available 
3. apt-key is deprecated
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.ubuntu.com/ubuntu bionic-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
W: Some index files failed to download. They have been ignored, or old ones used instead.

Solution: Ubuntu apt update GPG errors

To solve Ubuntu apt update GPG error, let’s first clean up system:

$ sudo apt-get clean

Backup:

$ sudo cp -a /var/lib/apt/lists /tmp 

Remove Lists:

sudo rm -r /var/lib/apt/lists/*   

Rebuild Package list:

First run this command:

$ sudo mkdir -p /var/lib/apt/lists/partial

Second command:

$ sudo apt-get clean

And finally,

$ sudo apt update

At this point, there is possibility of new errors (in addition to Ubuntu apt update GPG error), such as:

W: GPG error: http://security.ubuntu.com/ubuntu bionic-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://security.ubuntu.com/ubuntu bionic-security 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.

To fix above errors including Ubuntu apt update GPG error, we need to download key from keyserver.ubuntu.com and add to trusted set of keys:

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/user/0/apt-key-gpghome.JJHaZlKIWR/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
gpg: key 3B4FE6ACC0B21F32: public key "Ubuntu Archive Automatic Signing Key (2012) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1

Ouch, new warnings:

W: http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

To resolve Ubuntu apt update GPG error, now let’s try move keys from legacy trusted.gpg to trusted.gpg.d:

sudo mv /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/

Let’s try update again: 

Ubuntu 22.04 LTS Jammy Jellyfish: Fixing apt update issues

And finally, there are no more Ubuntu apt update GPG errors. 

Hurray!!

🙂

Quick Note: Please refer to Official Ubuntu Documentation if you are facing this issue on Ubuntu apt update GPG error.

📩 Stay ahead with expert insights on JavaScript, DevOps, and SRE trends.

💼 Interested in collaborations, partnerships, or sponsorships? Let’s connect! 🚀

Spread the love

team_cicdtrail

Only for Editorials, blogs and articles.

This Post Has 11 Comments

  1. Fenix

    Thanks! I just update today and had this very same issue, and your solution fixed it. You are the man! 🙂

    1. team_cicdtrail

      Awesome news Fenix, glad to know article helped!

  2. Camille

    Thanks but not working with protonvpn I dit everything you advised and stil… (sorry it is in French 😉
    W: Erreur de GPG : stable InRelease : Les signatures suivantes n’ont pas pu être vérifiées car la clé publique n’est pas disponible : NO_PUBKEY 4EDE055B645F044F
    E: Le dépôt stable InRelease n’est pas signé.
    N: Les mises à jour depuis un tel dépôt ne peuvent s’effectuer de manière sécurisée, et sont donc désactivées par défaut.
    N: Voir les pages de manuel d’apt-secure(8) pour la création des dépôts et les détails de configuration d’un utilisateur.

  3. tino

    truly easy, thank you i’ve learned something new today! Problem solved!!

  4. Farouk

    Wow you just done it with this solution, thank you.

  5. Baljeet

    Excellent stuff here. Lot of attempt you put to create step by step solution.

  6. Anonymous

    Does your blog һave a contact ρage? I’m hɑving ⲣroblems locating іt bսt, I’d
    like to send you an е-mail. I’vе got some ideas fߋr уour blog уоu
    miɡht be interested іn hearing. Eithеr way, great website and I looҝ forward t᧐ ѕeeing it improve оver tіme.

  7. Nick

    Fixed my issue. Superb blog! Thanks

  8. Joe

    Did not work kept screen shot if you would like me to attach to something? This solution did not work.
    I completely purged Opera using Synaptic Package Manager as suggested on another page. Even after that the Software Updater still stated: Failed to download repository Information. Check Internet connection. I checked all the previous two Opera keys where removed. The new Opera June 2023 100.0.4815.21_amd64 update seems to be acting like a virus. it say I posted i have not

Leave a Reply