You can find the answer in
this post, but I also document it here so I'll have a permanent copy.
Let's suppose you've got an error like this:
W: GPG error: http://ftp.de.debian.org stable/non-US Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F1D53D8C4F368D5D
W: You may want to run apt-get update to correct these problems
You should run the following to fix it (substitute
F1D53D8C4F368D5D with the one from your error message):
gpg --keyserver subkeys.pgp.net --recv F1D53D8C4F368D5D
gpg --export --armor F1D53D8C4F368D5D | apt-key add -
Now you can run
apt-get update
and will not get an error message.
Comments
sudo gpg --keyserver
sudo gpg --keyserver subkeys.pgp.net --recv F1D53D8C4F368D5D
gpg: requesting key 4F368D5D from hkp server subkeys.pgp.net
gpg: key 4F368D5D: public key "Debian Archive Automatic Signing Key (2005) <ftpmaster@debian.org>" imported
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: Total number processed: 1
gpg: imported: 1
sudo gpg --export --armor F1D53D8C4F368D5D | apt-key add -
gpg: can't open `/etc/apt/trusted.gpg'
gpg: keydb_get_keyblock failed: eof
gpg: no writable keyring found: eof
gpg: error reading `-': general error
gpg: import from `-' failed: general error
So don't work
are keyrings installed?
On Debian it's the
debian-archive-keyring
package, on Ubuntu it's theubuntu-keyring
package. If you've the keyring package installed, then try to update the keys with anapt-key update
first and try to add the missing key (as described in my original post) only afterwards.sudo doesnt carry across the
sudo gpg --export --armor F1D53D8C4F368D5D | sudo apt-key add -
Note the second 'sudo'
Re: sudo doesnt ...
sudo
since it makes life a lot easier if you've to execute several commands in a row with root privileges.sudo
gpg --armor --export KEY_NUMBER | sudo apt-key add -
solved the problem for me!
You may need to try different key servers
gpg --keyserver wwwkeys.eu.pgp.net --recv 9AA38DCD55BE302B
gpg --export --armor 9AA38DCD55BE302B | apt-key add -
Worked fine! Thank you very
Many many thanks
Gotta love the internet!
Thanks
Thanx very much
different keys!
Unfortunately
gpg --keyserver wwwkeys.pgp.net --recv 9AA38DCD55BE302B
gpg --export --armor 9AA38DCD55BE302B | apt-key add -
keyrings and updates
What might be the original cause
Re: What might be the original cause
apt-key
is a shell-script so it's easy to peek in on it's logic. Check out your/etc/apt/*.gpg
files. I've there the following:$ ls -al /etc/apt/*.gpg
-rw------- 1 root root 0 2008-10-27 11:51 /etc/apt/secring.gpg
-rw------- 1 root root 1200 2010-06-14 15:56 /etc/apt/trustdb.gpg
-rw-r--r-- 1 root root 18617 2010-10-28 13:16 /etc/apt/trusted.gpg
apt-key
works with these files. Maybe one of them got corrupt. Try listing the contents of your key database prior to runningapt-key add ...
and after running it. Optionally you could try to recreate them (of course, make a backup of your old *.gpg before going into any experimentation.Server down!
gpg: requesting key 4F368D5D from hkp server subkeys.pgp.net
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error
Andromeda:ping subkeys.pgp.net
PING subkeys.pgp.net (116.240.198.71) 56(84) bytes of data.
^C
--- subkeys.pgp.net ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1008ms
Andromeda:
Help!
Re: Server down!
http://unix.stackexchange.com/questions/75892/keyserver-timed-out-when-trying-to-add-a-gpg-public-key