In many articles around the Internet about Ubuntu (including ours), they require you to add a PPA to get the latest version of programs. PPAs are very useful, but when missing PPA keys pile up, it's not exactly the easiest of situations to take care of.
To get a PPA key, you normally have to go the Terminal and type in a separate command for every missing PPA key, which might take a while if you have many PPA keys missing.
If only there was an easier way. Like, an automatic way to do the job for us.
Well there is. If you're missing any PPA keys, you can simply paste the Terminal command below to do the job of for you. ;grin
Code:
- Code: Select all
sudo apt-get update 2> /tmp/keymissing; for key in $(grep "NO_PUBKEY" /tmp/keymissing |sed "s/.*NO_PUBKEY //"); do echo -e "nProcessing key: $key"; gpg --keyserver subkeys.pgp.net --recv $key && gpg --export --armor $key | sudo apt-key add -; done
An even easier (and more automatic) way of getting missing PPA keys would be by running a little script called launchpad-update http://bazaar.launchpad.net/~oldman/%2B ... pad-update when you update your software sources.
First off download launchpad-update http://bazaar.launchpad.net/~oldman/%2B ... pad-update to the desktop, right click on the file, go to "Properties", tick the "Allow executing file as program" box in the "Permissions" tab and then run the command below:
- Code: Select all
cd Desktop && sudo mv launchpad-update /usr/bin && echo "APT::Update::Pre-Invoke {\"if [ -x /usr/bin/launchpad-update ]; then /usr/bin/launchpad-update; fi;\"};" > 05ppa && sudo mv 05ppa /etc/apt/apt.conf.d/
Now everytime that you update your software sources, it will automatically get the missing PPA GPG keys for you. You can also run "launchpad-update" anytime if you wish to get the missing PPA GPG keys.
End Update
Solve missing gpg key error ie: W: GPG error: http://ppa.launchpad.net intrepid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 778978B00F7992B0
W: You may want to run apt-get update to correct these problems [/color]:o
I made a perl script that:
- Can detect and fix any launchpad PPA link in /etc/apt/sources.list
- Backs up the original /etc/apt/sources.list as /etc/apt/sources.list.backup
- Imports GPG keys for the links detected in /etc/apt/sources.list
Requirements:
- Administrative privileges
- Perl
- Internet connection
- HTML::Parser
Open a terminal Applications>accesories>terminal & paste this
Select all text in blue
sudo apt-get install libhtml-parser-perl
mkdir gpg-fix && cd gpg-fix
wget http://savvas.radevic.com/launchpad/change.tar.gz -O change.tar.gz
tar xzvf change.tar.gz
perl ./*.pl
cd ..
rm -Rf gpg-fix
sudo apt-get update ( wait for a while while it gets the keys ) coffee yum







