It all started when i executed -
sudo apt-get update
on my Ubuntu 12.04(Precise Pangolin). After fetching the required updates it showed me an error at the bottom - W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6AF0E1940624A220
Screen-shot for the same is given below -
Clearly we need to download the key from Ubuntu key server.
Things to check before you see Approach 1 and 2.
Once you have copied the data to file. Save it. Then run the following command
sudo apt-key add key1
You will get an "OK" response.
aniket@aniket-Compaq-610:~/Desktop$ sudo apt-key add key1
[sudo] password for aniket:
OK
And you are done. Repeat the procedure of other keys that might be missing.
Then you can run
sudo apt-get update
and you will not get any error. Update happens smoothly. Do let me know if you still have any doubts.
sudo apt-get update
on my Ubuntu 12.04(Precise Pangolin). After fetching the required updates it showed me an error at the bottom - W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6AF0E1940624A220
Screen-shot for the same is given below -
Clearly we need to download the key from Ubuntu key server.
Things to check before you see Approach 1 and 2.
- Open the file
~/.gnupg/gpg.conf
with the editor. - From the terminal
gedit ~/.gnupg/gpg.conf
- Go to 116th like
keyserver hkp://keys.gnupg.net - Comment this out and add line above it so the setup now looks like
keyserver http://keyserver.ubuntu.com
#
keyserver hkp://keys.gnupg.net
# keyserver mailto:pgp-public-keys@keys.nl.pgp.net
# keyserver ldap://keyserver.pgp.com - Save the file.
Trying Reset(Did not help. Same error persisted)
Enter the following command on the terminal -
sudo rm /var/lib/apt/lists/* -vf
and then update your system using following command -
sudo apt-get update && sudo apt-get upgrade
1st Approach(Did not Work for me)
Run the following command -
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220This did not solve my problem. I got connection timed out.
Generally Ubuntu key-server uses port 11371 which may be blocked by tour firewall. So you can use 80 as the port -
sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6AF0E1940624A220
But even this did not solve my problem -
Errors i got by following both methods in this approach are in below screen-shot.
Note : Here if you are getting Connection refused then this may be a proxy problem. Check if you are behind any proxy or firewall.
2nd Approach(Worked for me)
If the command are not doing it for you, you have to do it on your own. After a long research on this problem i finally decided that the best thing to do was manually download the key and add it.This is how i did it.
Go to Ubuntu Key-server(Click here). Here you can search your key. In my case it was 6AF0E1940624A220. Note while searching for key pre-append the key with 0x. So search for 0x6AF0E1940624A220
Click on the link provided in the pub section.
Copy the whole text(highlighted in below screen shot) from the page and save it in a file(say filename is key1).
Once you have copied the data to file. Save it. Then run the following command
sudo apt-key add key1
You will get an "OK" response.
aniket@aniket-Compaq-610:~/Desktop$ sudo apt-key add key1
[sudo] password for aniket:
OK
And you are done. Repeat the procedure of other keys that might be missing.
Then you can run
sudo apt-get update
and you will not get any error. Update happens smoothly. Do let me know if you still have any doubts.
Related Links
- W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: (Ask Ubuntu)
- What is the difference between dpkg and aptitude/apt-get?
Thank you very much...worked so well..
ReplyDeleteThanks a lot. The second approached worked great.
ReplyDeleteSecond approach worked for me. I have no clue why these small issues are necessary all the time. Anyway, you helped me a lot! Thanks dude!
ReplyDeleteThe second option worked pretty good and fast for me.
ReplyDeleteThanks a lot man
Excellent it worked for me too, Thanks a lot
ReplyDeleteGreat, the 2nd approach worked smoothly (ubuntu 12.04).
ReplyDeleteThank You !
ReplyDeletetwo thumbs high up
ReplyDeleteThanks Aniket
ReplyDeleteWorked perfectly for me!
I know the feeling of getting stuck with this error. Glad it helped so many people!
ReplyDeleteSorry no the approaches work for me. I don't know how to do.
ReplyDeletehttps://drive.google.com/file/d/0B0WAJHUVk9sBbFhwVU9fNWNmSGs/edit?usp=sharing
Could you help
Thanks a lot the second approach worked for me too.
ReplyDeleteThank second tutotial work for me
ReplyDeleteThanks for this valuable post; the first approach worked for me.
ReplyDeleteThanks.. First approach worked for me
ReplyDeleteIt did not word for me... Neither the first or the second option; what can I do?
ReplyDeleteneither worked for me either. after doing the second option I get Fetched 2,624 kB in 8s (303 kB/s)
ReplyDeleteReading package lists... Done
root@Coldstone:~#
can you help me figure out what I did wrong?
@mib could you give some more specific as in what difficulty or what part is not working ?
ReplyDelete@Knoxville Looking at the output it seems your public key not available error is not longer occurring and your packages are up to date. Am I missing something? If some broken packages are creating problem try "sudo apt get clean" and then update.
no they arent updating, I've rebooted the server and tried again and after it reads the package list it does nothing but drop me back to the cursor. since 14.01 lts is available for ubuntuserver now thru apt I may just reinstall anyway if I cant get this fixed easily. its not doing anything critical as its my home server that I use to tinker with so its not that big of deal, just a big hassle.
ReplyDeleteHi, I am getting following error :
ReplyDelete"W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY CBD000C02853C2C3"
And the key that i am missing is unavailable on link given. - See more at: http://opensourceforgeeks.blogspot.in/2013/04/w-gpg-error-httpppalaunchpadnet-precise.html?showComment=1425590525730#c3487138071342912992
thanks! 2nd approach worked for me too on ubuntu 14.04
ReplyDeleteThanks a lot!!! WORKED!!!
ReplyDeletethanks it worked for me
ReplyDeleteGreat!
ReplyDeleteGreat. Thanks for this solution. Tried the second approach and it worked.
ReplyDeletethanks a lot ...2nd approach worked for me. :D
ReplyDeleteAnd the second soultion worked!! Thanks!!
ReplyDeleteThanks Aniket!
ReplyDeleteThanks for taking the time to post this. Second solution ftw!
ReplyDeleteThanks, a ton man. Really worked for me!!!
ReplyDeleteReally nice!
ReplyDeletewhen i save the file and run terminal sudo apt-key add key1
ReplyDeleteno such file or directory ..... so what i should to do
Thanks!!
ReplyDeleteModifying gpg.conf and resetting did not work for me either. However the first approach (getting the missing key) did work. I was missing a different key, though (4DF9B28CA252A784). Thanks for the help.
ReplyDeleteSecond option worked for me. Thanks a bunch
ReplyDelete2nd approach worked !! Thanks a tonne !!
ReplyDeleteThis was so helpful thank you!
ReplyDeleteThankyou so much... It helped me..
ReplyDeletethanks very much!!!
ReplyDeleteThanks. The 2nd approach worked for me.
ReplyDeleteThank you. The 2nd approach work for me.
ReplyDeletethanks it worked for me .
ReplyDeletei am not able get ok in both case
ReplyDeleteafter doing second approach
i am getting as --- > krishna@ubuntu:~$ cd Desktop/
krishna@ubuntu:~/Desktop$ touch key.txt
krishna@ubuntu:~/Desktop$ vi key.txt
krishna@ubuntu:~/Desktop$ ls
key.txt
krishna@ubuntu:~/Desktop$ sudo apt-key add key.txt
[sudo] password for krishna:
gpg: no valid OpenPGP data found.
GPG error: http://apt.osmc.tv jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 553B25A766C762CC
ReplyDeletecan u pls resolve this issue.
Thank you from 2017!
ReplyDelete1. when sudo apt-get update, I've error like this,
ReplyDeleteFetched 316 B in 11s (27 B/s)
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net precise Release: The following signatures were invalid: BADSIG 03396E1C3F7B4A1D Launchpad Misakovi
2. Then, I've searched key in keyserver.ubuntu, copas it then saved it as Misakovi.
azumah@azumah-Aspire-4310:$ sudo apt-key add Misakovi
OK
3. sudo apt-get update, but still result same error in step no. 1.
4. I've also tried azumah@azumah-Aspire-4310:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 03396e1c3f7b4a1d
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.DWWiaeKsru --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys 03396e1c3f7b4a1d
gpg: requesting key 3F7B4A1D from hkp server keyserver.ubuntu.com
gpg: key 3F7B4A1D: "Launchpad Misakovi" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
5. sudo apt-get update result in same error still.
Is anyone could do me a favour? Thanks.
Worked for me. Thanks a lot :)
ReplyDeleteSecond approach worked like a charm. Thank you so much!
ReplyDelete