There are times when running apt-get update
in Ubuntu will result in error messages such as the following:
[chris@server ~]$ sudo apt-get update Ign http://security.ubuntu.com trusty-security InRelease Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B] ... Fetched 21.9 MB in 14s (1,537 kB/s) Reading package lists... Done W: GPG error: http://security.ubuntu.com trusty-security Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 W: GPG error: http://archive.canonical.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 W: GPG error: http://archive.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 W: GPG error: http://archive.ubuntu.com trusty-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 [chris@server ~]$
If these errors aren’t fixed, apt will have problems when installing or upgrading packages. For example:
[chris@server ~]$ sudo apt-get upgrade Reading package lists... Done Building dependency tree... Done Calculating upgrade... Done ... E: Some packages could not be authenticated [chris@server ~]$
The apt packaging system has a set of trusted keys that determine whether a package can be authenticated and therefore trusted to be installed on the system. Sometimes the system does not have all the keys it needs and runs into this issue. Fortunately, there is a quick fix. Each key that is listed as missing needs to be added to the apt key manager so that it can authenticate the packages.
Looking at the error above, apt is telling us that the following keys are missing: 40976EAF437D05B5
and 3B4FE6ACC0B21F32
. Notice that these are listed multiple times. Each unique key will only need to be added once.
To add these keys, run the following commands:
[chris@server ~]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.QTeppiINUh --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 gpg: requesting key 437D05B5 from hkp server keyserver.ubuntu.com gpg: key 437D05B5: public key "Ubuntu Archive Automatic Signing Key" imported gpg: Total number processed: 1 gpg: imported: 1 [chris@server ~]$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.77TqYGKU7b --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 gpg: requesting key C0B21F32 from hkp server keyserver.ubuntu.com gpg: key C0B21F32: public key "Ubuntu Archive Automatic Signing Key (2012) " imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) [chris@server ~]$
If the keys that your system is missing differs, simply replace the key at the end of the above command with your key and run it.
Did I help you?
this solved my problem
thank you !
This solved my nagging troubles. Thanks a bunch
Hi!
Worked for me too:)
I’m sorry, did not work for me:
…
W: GPG error: http://download.opensuse.org Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 0429ACCAF7AA50B3
~/ #
I tried the solution and it failed:
~/ # sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 0429ACCAF7AA50B3
Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /tmp/tmp.Nd5sw1reOg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –primary-keyring /etc/apt/trusted.gpg –keyserver keyserver.ubuntu.com –recv-keys 0429ACCAF7AA50B3
gpg: requesting key F7AA50B3 from hkp server keyserver.ubuntu.com
gpgkeys: key 0429ACCAF7AA50B3 not found on keyserver
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
~/ #
It looks like openSUSE doesn’t maintain keys on the Ubuntu keyserver. You’ll have to manually download the appropriate key and add it to your system using
add-key
. You can find an example here.This worked! Thank you very much.
really really really really thanks!
Thanks – worked for me a treat!
Grazie mille from Italy! (thank you so much!)
Many thanks!
thanks man!
Thank you for this info. Could not find the proper command to install the missing public key until this website.
Thanks works great!!!
This is awesome … thank you
NOTE : Every one change the key with the key the error carry .. GOOD LUCK 🙂
As others said – awesome!
So easy, just need to replace keys. I´ll bookmark this page. 😉
Thank you very much. Regards, krst0
Thank you for your helpful post. It solved my problem. Really.
its work, thanks 🙂
[…] couldn’t be verified because the public key is not available.” A search led to instructions to run this […]
Thanks! I’ve had that error hanging around for ever.
tnx dude
Hello;
Thanks for this, it was helpful
[…] Apt-key commands https://chrisjean.com/fix-apt-get-update-the-following-signatures-couldnt-be-verified-because-the-pu… […]
I had to run the following commands before this worked.
sudo mv /etc/apt/trusted.gpg.d/ /etc/apt/trusted.gpg.d.backup
sudo mkdir /etc/apt/trusted.gpg.d
sudo chmod 755 /etc/apt/trusted.gpg.d
Then run sudo apt-get update . You will see more key errors, add all the keys you see
Looks like you ran into the “keyblock resource” bug and followed the solution documented here. I’m making note of that resource in case others see your comment and want to know more.
The gift that keeps on giving…
This site post has helped me now on two separate occasions so I’d like to pass on my heartfelt thanks.
I’ve used the info to help me sort out the nightmare of removing the dreaded/awful systemd from my systems.
Cheers.
Thank youuuuuuu
Thank you so much. Appreciate your help.
Worked a treat, many thanks
Thank you so much, it worked for me 🙂
freakin’ WORKED, thank you
Thank’s! This solve my problem.
Thank you so much! It solved my problem!
thanks for help! 🙂
Thanks! Worked perfectly 🙂
Thanks a lot
sorrry!but it didnt work for me.
$ sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys EB3E94ADBE1229CF
Executing: /tmp/apt-key-gpghome.ekSEO9yMc8/gpg.1.sh –keyserver keyserver.ubuntu.com –recv-keys EB3E94ADBE1229CF
gpg: keyserver receive failed: Connection timed out
it shows this error !
what should i do
Looks like your system is having problems contacting
keyserver.ubuntu.com
. This might be a temporary issue with that server which means that you should try again at a later time to see if the problem resolves itself. If the issue persists, it’s possible that the request is being blocked by a firewall (either on your system, on the network this system runs in, or possibly on the network forkeyserver.ubuntu.com
).You can also try different servers and being more explicit with the format of the server, such as:
Alternate servers to try are:
hkp://keys.gnupg.net:80
hkp://pgp.mit.edu:80
hkp://sks-keyservers.net:80
hkp://keyserver.pgp.com:80
Thanks for the solution…it worked for all my missing keys but one.
I have check (sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 9B36C042D8190918) all the alternate servers you suggested
hkp://keys.gnupg.net:80
hkp://pgp.mit.edu:80
hkp://sks-keyservers.net:80
hkp://keyserver.pgp.com:80
but I keep getting the ‘gpg: keyserver receive failed: No data’…I do not get why it worked with the other keys but this one…
Nicolas
Does the solution listed here work?
This solved my problem. Thank you.
Helped a lot. Thank you!
Thank you, sir
It solved my issue
Dude, you are very much thanked for uploading this solution…you are a gem!! Thanks a lot,… love this website
it worked . Thanks
¡Muchas gracias! Me ha servido mucho, creí que tendría que formatear mi PC por cuarta vez. Gracias.
It helped, thanks! :))
Thank you!
Muchas gracias ¡¡ Despues de 2 días de buscar tener el error. Lo corregí ¡¡
Thank you!!!
This was useful, thanks 🙂
Still works. Thanks.
Great! Thank you!
thanks a lot !!
Thanks!
Saved my time 🙂
Thank you! Solved the issue for me (my Jenkins wasn’t updating).
FINALLY!!!! A solution that solved that problem for ever!!!!
Thank you!
Thank you! I wanted to upgrade from Ubuntu 18.04 to 20.04 but due to broken update I was not able to. It fixed my problem..