I have just installed Ubuntu 12.04 and I added some repo, and when I did apt-get update
, I got missing gpg key.
Following command seems to doesn't work for me:
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 && sudo gpg --export --armor $key | apt-key add -; done
How to fix this problem?
I liked this solution, re-download the missing keys from the Ubuntu key server.
For Ubuntu
In my case
Here is the command to add the missing key mentioned in the error message.
So I take the missing key
2EA8F35793D8809A
and ask the keyserver.ubuntu.com to added it to the list of keys I have in apt.For linux mint
Your key server is slightly different
keyserver.linuxmint.com
Alternative key servers to try
keyserver.ubuntu.com
There is a software called as
Y PPA manager
It can help fix GPG keys errors.Y PPA manager
To install -
Once you install it start it ,then go to
advance
and select "import all missing GPG keys"The automatic download using
apt-key adv --recv-keys
may not work behind a firewall.In this case, open the webpage of Ubuntu Key Server in your web browser and search for the string
0x<hexadecimal code of your missing key>
.Open the link in the pub section. Save the key contents (from
-----BEGIN PGP PUBLIC KEY BLOCK-----
to-----END PGP PUBLIC KEY BLOCK-----
) as a file.Then run:
Source: http://opensourceforgeeks.blogspot.in/2013/04/w-gpg-error-httpppalaunchpadnet-precise.html
first enter the following command in the terminal
then update your system by entering the following command in the terminal
after this there should be no errors and everything should work fine.
For Ubuntu 12.04 Precise: Permanent solution
to this error message occuring after adding a new repository and updating repository list. This is due to a server which address is no more valid. So just change the address to a good one.
Open the file
~/.gnupg/gpg.conf
with a text editor.In terminal:
gedit ~/.gnupg/gpg.conf
then, in this file, find the following bold line (116th line) (which should be default as follow):
then add the following bold line, to finally give the following result:
(add # to the second line as follow to comment out the old address)
Save the file and try to update again:
In terminal:
sudo apt-get update
Based on nelaar answer:
The script dumps all the errors into a temporary file and then loops through them, importing the missing keys.
The Most Easiest Way Is With Y PPA MAnager
Open Y PPA Manager From Dash
Enter Your Admin Password
Double Click On Advanced Option
Click Try To Import All Missing GPG Keys
Click Ok To Fix It
What worked for me was to delete the key first and then reinstall. To achieve that I did the following:
deleting with
Then, re-install by typing
I wanted to automatically fix errors like this in a bash script. For anyone interested, this should do the trick:
The easiest way is simply:
sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
Or if behind a proxy:
sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com --keyserver-options http-proxy=http://myproxy:123
(replace
myproxy:123
with your actual proxy, of course)