If you get a GPG error when doing an apt-get update, here’s the quickest way to fix it.The error message looks similar to:
W: GPG error: http://security.debian.org etch/updates Release:
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY XXXXXXXXXXX: There is no public key available for the following key IDs: W: You may want to run apt-get update to correct these problems
By default, it says “You may want to run apt-get update to correct these problems”. The problem is, apt-get update doesn’t fix the keys automagically. To fix, you will need to update the debian keyring by typing:
apt-get install debian-archive-keyring
After installing the keyring, you will get a list of keys that were updated, added, or deleted. This should resolve the problem. It worked for me on apt-get update for an etch install that broke.