Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I download updates or installing new software I get these warnings that I have no public keys. This just appeared one day and I didn't remove/add something to create this.

Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192

I have tried: sudo apt-key update and it worked for some keys, but others are still missing, I need to add them.

I need help with adding the new keys and the address to all the keys. Those that aren't in Ubuntu and launchpad.

share|improve this question
up vote 3 down vote accepted

Getting the Keys, Part 1

The program addgpg-apt - which is mine - will only work if the keys are on the Ubuntu keyserver, unless you specifically specify what key server you are trying to get the key from. It does not go out to the internet and find what key server the PGP key is on.

Using the following command:

sudo apt-get update | grep "NO_PUBKEY" | awk '{ system("addgpg-apt "$21) }'

Will systematically go through each line of output and send each key to addgpg-apt program. addgpg-apt will attempt to get the key from the Ubuntu keyservers.

For or items, it will work without issue. For keys for other GPG Keyservers, you'll need to find the locations of those keys in their respective keyserver, then use addgpg-apt with the --keyserver flag for each:

addgpg-apt --keyserver <keyserver> <keyid>

That will then take the keys and place them into your APT keyring.

The addgpg-apt program is available via PPA

If the first command fails, try this one:

sudo apt-get update | grep "NO_PUBKEY" | awk '{ print $21) }' | xargs addgpg-apt

This will perform the same action as above, only operates differently.

Getting the Keys, Part 2

I recommend checking the site(s) for the other non-Ubuntu and non-Launchpad repositories for the PGP keys, as they more than likely are listed there. After you find each one, you can run addgpg-apt --keyserver <keyserver> <keyid> and it will download from those repositories' key servers.

share|improve this answer
The error on the first command: W: GPG error: natty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A9E15C2F2B944FEE – Alvar Aug 3 '11 at 19:37
Part of the issue is where the keys come in some lines. That explains those keys not functioning. At some point in the future, I plan to create a supplementary program to this which greps through given input and will search for NO_PUBKEY and then utilize the argument/input item immediately after it – Thomas Ward Aug 3 '11 at 19:50
the answer that worked was addgpg-apt type-keycode-here . example: addgpg-apt E2B63FD93B8FE6DF – Alvar Aug 3 '11 at 19:55

Try this:

sudo apt-key adv --recv-key --keyserver 16126D3A3E5C1192

where '16126D3A3E5C1192' is the failed key


sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install launchpad-getkeys

Once installed, to import all the missing GPG keys for your PPAs, simply use the following command:

sudo launchpad-getkeys
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.