APT Key Verification Problems


If you get errors from apt-get about not being able to verify a key like this:

# apt-get update
. . .
Reading package lists... Done
W: There are no public key available for the following key IDs:
W: You may want to run apt-get update to correct these problems

You can retrieve a public key as follows:

# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 010908312D230C5F
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: requesting key 2D230C5F from hkp server wwwkeys.eu.pgp.net
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 2D230C5F: public key "Debian Archive Automatic Signing Key (2006) <ftpmaster@debian.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1

And then update your apt keys with:

# gpg --armor --export 010908312D230C5F | apt-key add -
gpg: no ultimately trusted keys found

or alternatively do both is one step with

# KEY=010908312D230C5F
# gpg --recv-keys $KEY && gpg --armor --export $KEY | apt-key add -

This will make the public key available to apt and remove the error.

Author: Bernt Hansen