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 F1D53D8C4F368D5Dgpg: 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-keyringpackage, on Ubuntu it's theubuntu-keyringpackage. If you've the keyring package installed, then try to update the keys with anapt-key updatefirst 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 ...
sudosince 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 9AA38DCD55BE302Bgpg --export --armor 9AA38DCD55BE302B | apt-key add -
Worked fine! Thank you very
Many many thanks
Gotta love the internet!
Thanks