Adding missing PPA keys to an apt keyring
If you are a user of a Linux distribution that takes advantage of Launchpad's Personal Package Archive, then you know how easy that tool can be for adding those hard to find applications pre-packaged for your system. Once you get used to PPAs, it's fairly easy to depend upon those repositories. But there is sometimes a, seemingly, insurmountable issue with those PPAs - keys. If the key for a particular PPA isn't given to you, you can't use the software -- not until the key is added to your keyring.
But how do you add the key when you never received it? Believe it or not, there is a simple solution for that task.
I'm going to assume you have the PPA added to to your /etc/apt/sources.list file (or added them with the commandÂ
sudo add-apt-repository ppa:chromium-daily.). After the PPA has been added, the next step before the installation of the software, is to run the command
sudo apt-get update. If the key hasn't been added an error will be displayed indicated the key is missing. When that error pops up, that particular PPA can not be used. The error will look like:
GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2524246B1CC723DB
The clue here is the last string of characters, which is the public key. In order to add the key for this particular PPA (or repository), issue the command:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEY_ID
Where KEY_ID is the last string of characters in the error (in this caseÂ 2524246B1CC723DB).
When the above command is issued, the following output will be displayed:
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys 2524246B1CC723DBgpg: requesting key 1CC723DB from hkp server keyserver.ubuntu.comgpg: key 1CC723DB: public key "Launchpad PPA for Chris Coulson" importedgpg:
Total number processed: 1gpg: imported: 1 Â (RSA: 1)
The important part of the above output is the final line, indicated that 1 of 1 key was processed. That PPA (or repository) can now be used.
Finding repos and PPA
There are plenty of repositories and PPAs out there. One very good place to start (other than Google) is Launchpad. When you go to launchpad you can search under Registered PPAs, Published sources, Active PPAs, and Published binaries. This site also breaks down PPAs according to release, which includes 6.06 to 11.04. Of course this is a Ubuntu-only site, so those repositories will only work for Ubuntu and distributions based on Ubuntu.
There is a GUI called gui-apt-key. You can find that in Synaptic (search for "gui-apt-key", Â mark it for installation, and click Apply to install.) This tool basically allows you to take the key ID, enter it in a small text area, and push the Add button in order to add a key to your keyring. If you prefer a GUI tool, it's a good route to go. Personally, I prefer using the command line, as it is more reliable and more flexible.
Sometimes those apt errors can be a real pain. But when the error is a missing key, there is always a quick solution for adding that key.Advertisement