Many of my signatures/public keys for my repos disappeared!

Here is a story of a demented Ubuntu install.

One day, after being installed, loved and showing other OSes who was boss it decided to remove many of its stored signatures/public keys - all on its own!

The Ubuntu install coped well but its user found it difficult to work around when trying to apt-get update.

If it was possible to update without the verification the user decided to give it a go (acknowledging the risks) and... well they both knew this was no way to go on.

So - to the internet, where all the other Ubuntu users reside!

breaking narrator character for a moment

The last apt-get update I ran gave this set of errors:

W: An error occurred during the signature verification. 
The repository is not updated and the previous index files will be used. 
GPG error: http ://gb.archive.ubuntu.com maverick Release: 
The following signatures were invalid: 
BADSIG 40976EAF437D05B5
Ubuntu Archive Automatic Signing Key <[email protected]>
W: GPG error: http ://ppa.launchpad.net maverick Release: 
The following signatures couldn't be verified because the public key is not available:
NO_PUBKEY 61E091672E206FF0
W: An error occurred during the signature verification. 
The repository is not updated and the previous index files will be used.
GPG error: http ://ppa.launchpad.net maverick Release: 
The following signatures were invalid:
BADSIG 9DAD42D740C11E40
Launchpad Cloudsn Reporitory
W: An error occurred during the signature verification. 
The repository is not updated and the previous index files will be used. 
GPG error: http ://ppa.launchpad.net maverick Release: 
The following signatures were invalid: 
BADSIG B725097B3ACC3965
Launchpad lffl
W: GPG error: http ://ppa.launchpad.net maverick Release: 
The following signatures couldn't be verified because the public key is not available:
NO_PUBKEY 6D3B959722E58263
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/maverick/Release
W: Failed to fetch http://ppa.launchpad.net/chuchiperriman/cloudsn/ubuntu/dists/maverick/Release
W: Failed to fetch http://ppa.launchpad.net/ferramroberto/vlc/ubuntu/dists/maverick/Release
W: Failed to fetch http://nightlies.videolan.org/build/intrepid-i386/arch/./Packages.gz
404  Not Found
W: Failed to fetch http://ppa.launchpad.net/nilarimongard/webupd8/ubuntu/dists/maverick/main/source/Sources.gz
404  Not Found
W: Failed to fetch http://ppa.launchpad.net/nilarimongard/webupd8/ubuntu/dists/maverick/main/binary-i386/Packages.gz
404  Not Found
W: Some index files failed to download, they have been ignored, or old ones used instead.

I have read on Ubuntu Forums that I can go through each missing sig/key one-by-one and get it back. This seems quite long winded as a solution.

Is there a line of code to automatically find any and all missing keys? Or am I doomed to dig through these manually to become happy-ever-after?


Solution 1:

Launchpad-Getkeys (a small script packed in a .deb for easy installation) automatically imports all missing GPG keys.

To install and use it, open a terminal and copy/paste the following commands:

cd ~/Downloads
wget https://launchpad.net/~nilarimogard/+archive/webupd8/+files/launchpad-getkeys_0.3.1-1%7Ewebupd8%7Emaverick3_all.deb
sudo dpkg -i launchpad-getkeys*.deb
sudo launchpad-getkeys

The first command above changes the directory to your Downloads folder, the second downloads the .deb, third command installs the .deb and the last command runs "launchpad-getkeys" script which automatically imports all missing GPG keys.

If you're using a proxy, there are some things you need to change though so let me know if you need info on that too.

By the way, I see you have some other errors too, not just GPG keys. It looks like you have some broken PPA .list files (for instance I see you get a 404 not found error for the WebUpd8 PPA which can't be since the PPA exists all the way from Jaunty to Natty - maybe your Internet connection was down?).