Automatically Import GPG Keys for PPAs


Automatically Import GPG Keys for PPAs
The "add-apt-repository" command in Ubuntu can help you to add a PPA via command line. This command also imports the GPG key. Problem arise when you add a PPA while the Ubuntu keyserver is down, so you’ll have no any GPG key added.

This will give you a failure when you run apt-get update. This kind of error will you get on your monitor screen:



W: GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A9BF3BB4E5E17B5
W: GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B22AB97AF1CDFA9
W: You may want to run apt-get update to correct these problems

So to add all the missing GPG keys when the Ubuntu keyserver is down you can run this command.
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install launchpad-getkeys

Once you have done, run this command:
sudo launchpad-getkeys
After you imported all missing GPG key, you will not see anymore failure of the update. Hope it helps.

No comments:

Post a Comment