Fixing apt-get GPG problems
Problem
myhost:/etc/apt# apt-get update
Get:1 http://security.debian.org testing/updates Release.gpg [836B]
Ign http://security.debian.org testing/updates/main Translation-en_US
Ign http://security.debian.org testing/updates/contrib Translation-en_US
Hit http://security.debian.org testing/updates Release
Err http://security.debian.org testing/updates Release
Get:2 http://security.debian.org testing/updates Release [38.4kB]
Get:3 http://ftp.debian.org testing Release.gpg [836B]
Ign http://ftp.debian.org testing/main Translation-en_US
Hit http://ftp.debian.org testing Release
Ign http://security.debian.org testing/updates Release
Err http://ftp.debian.org testing Release
Ign http://security.debian.org testing/updates/main Packages/DiffIndex
Ign http://security.debian.org testing/updates/contrib Packages/DiffIndex
Ign http://security.debian.org testing/updates/main Sources/DiffIndex
Ign http://security.debian.org testing/updates/contrib Sources/DiffIndex
Get:4 http://ftp.debian.org testing Release [119kB]
Hit http://security.debian.org testing/updates/main Packages
Hit http://security.debian.org testing/updates/contrib Packages
Hit http://security.debian.org testing/updates/main Sources
Hit http://security.debian.org testing/updates/contrib Sources
Ign http://ftp.debian.org testing Release
Hit http://ftp.debian.org testing/main Packages/DiffIndex
Hit http://ftp.debian.org testing/main Sources/DiffIndex
Fetched 159kB in 4s (36.5kB/s)
Reading package lists... Done
W: GPG error: http://security.debian.org testing/updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA
W: GPG error: http://ftp.debian.org testing Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA
W: You may want to run apt-get update to correct these problems
myhost:/etc/apt# apt-key adv --keyserver keyring.debian.org --recv-keys
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --keyserver keyring.debian.org --recv-keys
myhost:/etc/apt# apt-key adv --keyserver keyring.debian.org --recv-keys AED4B06F473041FA
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --keyserver keyring.debian.org --recv-keys AED4B06F473041FA
gpg: requesting key 473041FA from hkp server keyring.debian.org
gpgkeys: key AED4B06F473041FA not found on keyserver
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
myhost:/etc/apt# apt-get update
Get:1 http://security.debian.org testing/updates Release.gpg [836B]
Ign http://security.debian.org testing/updates/main Translation-en_US
Ign http://security.debian.org testing/updates/contrib Translation-en_US
Hit http://security.debian.org testing/updates Release
Err http://security.debian.org testing/updates Release
Get:2 http://security.debian.org testing/updates Release [38.4kB]
Get:3 http://ftp.debian.org testing Release.gpg [836B]
Ign http://ftp.debian.org testing/main Translation-en_US
Hit http://ftp.debian.org testing Release
Ign http://security.debian.org testing/updates Release
Err http://ftp.debian.org testing Release
Ign http://security.debian.org testing/updates/main Packages/DiffIndex
Ign http://security.debian.org testing/updates/contrib Packages/DiffIndex
Ign http://security.debian.org testing/updates/main Sources/DiffIndex
Ign http://security.debian.org testing/updates/contrib Sources/DiffIndex
Get:4 http://ftp.debian.org testing Release [119kB]
Hit http://security.debian.org testing/updates/main Packages
Hit http://security.debian.org testing/updates/contrib Packages
Hit http://security.debian.org testing/updates/main Sources
Hit http://security.debian.org testing/updates/contrib Sources
Ign http://ftp.debian.org testing Release
Hit http://ftp.debian.org testing/main Packages/DiffIndex
Hit http://ftp.debian.org testing/main Sources/DiffIndex
Fetched 159kB in 4s (38.5kB/s)
Reading package lists... Done
W: GPG error: http://security.debian.org testing/updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA
W: GPG error: http://ftp.debian.org testing Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA
W: You may want to run apt-get update to correct these problems
myhost:/etc/apt#
Solution
myhost:/etc/apt# wget http://ftp-master.debian.org/keys/archive-key-6.0.asc
--2011-04-06 23:27:27-- http://ftp-master.debian.org/keys/archive-key-6.0.asc
Resolving ftp-master.debian.org... 128.148.34.3
Connecting to ftp-master.debian.org|128.148.34.3|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5587 (5.5K) [text/plain]
Saving to: `archive-key-6.0.asc'
100%[==========================================================================================================================================>] 5,587 --.-K/s in 0.1s
2011-04-06 23:27:27 (56.2 KB/s) - `archive-key-6.0.asc' saved [5587/5587]
myhost:/etc/apt# gpg --import archive-key-6.0.asc
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: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 473041FA: public key "Debian Archive Automatic Signing Key (6.0/squeeze) " imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
gpg: no ultimately trusted keys found
myhost:/etc/apt# gpg --fingerprint 473041FA
pub 4096R/473041FA 2010-08-27 [expires: 2018-03-05]
Key fingerprint = 9FED 2BCB DCD2 9CDF 7626 78CB AED4 B06F 4730 41FA
uid Debian Archive Automatic Signing Key (6.0/squeeze)
myhost:/etc/apt# gpg --armor --export 473041FA | sudo apt-key add -
OK
myhost:/etc/apt# apt-get update
Get:1 http://security.debian.org testing/updates Release.gpg [836B]
Ign http://security.debian.org testing/updates/main Translation-en_US
Ign http://security.debian.org testing/updates/contrib Translation-en_US
Get:2 http://security.debian.org testing/updates Release [38.4kB]
Get:3 http://ftp.debian.org testing Release.gpg [836B]
Ign http://ftp.debian.org testing/main Translation-en_US
Get:4 http://security.debian.org testing/updates/main Packages [14B]
Get:5 http://ftp.debian.org testing Release [119kB]
Get:6 http://security.debian.org testing/updates/contrib Packages [14B]
Get:7 http://security.debian.org testing/updates/main Sources [14B]
Get:8 http://security.debian.org testing/updates/contrib Sources [14B]
Get:9 http://ftp.debian.org testing/main Packages [6820kB]
Get:10 http://ftp.debian.org testing/main Sources [4789kB]
Fetched 11.8MB in 47s (249kB/s)
Reading package lists... Done
myhost:/etc/apt#
Eugene Koontz
Last modified: Wed Apr 6 23:38:36 PDT 2011