apt - Fix GPG error

When doing an apt-get update to refresh index files from their sources, the indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list
Sometimes you will see an error like that:

debian:~# apt-get update
Get:1 http://www.backports.org etch-backports Release.gpg [189B]
Hit http://www.backports.org etch-backports Release    
(output shortened)
Hit http://security.debian.org etch/updates/contrib Packages
Hit http://security.debian.org etch/updates/main Sources
Hit http://security.debian.org etch/updates/contrib Sources
Fetched 180kB in 2s (75.2kB/s)
Reading package lists... Done
W: GPG error: http://www.backports.org etch-backports Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EA8E8B2116BA136C
W: You may want to run apt-get update to correct these problems

The error message is pretty understandable.
To resolve this problem, you only have to fetch the public key(s) from the mirror and execute apt-key add <keyfile>

debian:~# apt-key add archive.key

After adding the key, your update should work…

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>