apt-get update NO_PUBKEY
It has been a while since my last maintenance on office debian server. It’s just my plain laziness. :p I was quite happy with apt tool set for debian box maintenance.
Happily, I fired up the command, apt-get update and it complained about NO_PUBKEY for 2 public keys. Am I missing something?
Obviously, quite a lot. :p It’s nothing new really. Just that I didn’t keep up-to-date with debian stuff lately.
mdebian:~# apt-get update
Get:1 http://security.debian.org stable/updates Release.gpg [189B]
Hit http://security.debian.org stable/updates Release
Ign http://security.debian.org stable/updates Release
Get:2 http://non-us.debian.org stable/non-US Release.gpg [197B]
Ign http://security.debian.org stable/updates/main Packages
Get:3 http://http.us.debian.org stable Release.gpg [378B]
Ign http://security.debian.org stable/updates/contrib Packages
Ign http://security.debian.org stable/updates/non-free Packages
Hit http://non-us.debian.org stable/non-US Release
Hit http://security.debian.org stable/updates/main Packages
Hit http://security.debian.org stable/updates/contrib Packages
Ign http://non-us.debian.org stable/non-US/main Packages
Hit http://security.debian.org stable/updates/non-free Packages
Ign http://non-us.debian.org stable/non-US/contrib Packages
Ign http://non-us.debian.org stable/non-US/non-free Packages
Hit http://http.us.debian.org stable Release
Ign http://http.us.debian.org stable Release
Hit http://non-us.debian.org stable/non-US/main Packages
Ign http://http.us.debian.org stable/main Packages
Hit http://non-us.debian.org stable/non-US/contrib Packages
Ign http://http.us.debian.org stable/contrib Packages
Ign http://http.us.debian.org stable/non-free Packages
Hit http://non-us.debian.org stable/non-US/non-free Packages
Hit http://http.us.debian.org stable/main Packages
Hit http://http.us.debian.org stable/contrib Packages
Hit http://http.us.debian.org stable/non-free Packages
Fetched 568B in 6s (86B/s)
Reading package lists… Done
W: GPG error: http://security.debian.org stable/updates Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A70DAF536070D3A1
W: GPG error: http://http.us.debian.org stable Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A70DAF536070D3A1 NO_PUBKEY B5D0C804ADB11277
W: You may want to run apt-get update to correct these problems
SOLUTION
The solution was rather simple; import both missing public keys.
mdebian:~# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys A70DAF536070D3A1
mdebian:~# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys B5D0C804ADB11277
mdebian:~# gpg --armor --export A70DAF536070D3A1 | apt-key add -
mdebian:~# gpg --armor --export B5D0C804ADB11277 | apt-key add -
If HKP is not allowed, you could just use this keyserver.
http://keyserver.linux.it/pks/lookup?op=get&search=0xB5D0C804ADB11277
http://keyserver.linux.it/pks/lookup?op=get&search=0xA70DAF536070D3A1
However, you need to extract the public key content and save them into files. Then import them with gpg --import /path/to/keyfile.
Should keep myself abreast with latest updates especially in IT world.



