Sunday 11 March 2012

How to solve GPG error when you run apt-get update your source list?

In computers based on a Debian operating system that uses Linux kernel, error messages may come up like 'NO_PUBKEY'.This happens while using the Apt-Get command line tool and this error is associated with the tool's update feature. The new feature in the Apt-Get package management toolguarantees the authenticity of the server before updating the Debian OS. That's why the error 'NO_PUBKEY' pops up. This problem can be solved by keying in the appropriate commands. 

Here I found a really helpful solution from this link.

When you add a repository in your /etc/apt/sources.list and run a apt-update you'll get the update of the newly added repository but also a warning about a GPG key like the following one:



Hit http://ppa.launchpad.net intrepid/main Sources
Hit http://fr.archive.ubuntu.com intrepid-proposed/universe Packages
Hit http://ppa.launchpad.net intrepid/main Packages
Fetched 309B in 0s (519B/s)
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net intrepid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D702BF6B8C6C1EFD


Running again apt-update won't solve the issue.
This warning can be safely ignored, but I don't like to leave warning when there is a solution to get rid of it... because when something is going wrong, it would complicate to sort out what is safe to be ignored and what tells about a real issue.

So, to get rid of this warning here is the two command you need to execute :

Expand this zonegpg --keyserver subkeys.pgp.net --recv D702BF6B8C6C1EFD
gpg --export --armor D702BF6B8C6C1EFD  | sudo apt-key add -
sudo apt-get update


which will give this output :


Expand this zone !
thomas@daisybox:~$ gpg --keyserver subkeys.pgp.net --recv D702BF6B8C6C1EFD                                                                                                                                                                                
gpg: directory `/home/thomas/.gnupg' created                                                                                                                                                                                                              
gpg: new configuration file `/home/thomas/.gnupg/gpg.conf' created                                                                                                                                                                                        
gpg: WARNING: options in `/home/thomas/.gnupg/gpg.conf' are not yet active during this run                                                                                                                                                                
gpg: keyring `/home/thomas/.gnupg/secring.gpg' created                                                                                                                                                                                                    
gpg: keyring `/home/thomas/.gnupg/pubring.gpg' created                                                                                                                                                                                                    
gpg: requesting key 8C6C1EFD from hkp server subkeys.pgp.net                                                                                                                                                                                              
gpg: /home/thomas/.gnupg/trustdb.gpg: trustdb created                                                                                                                                                                                                     
gpg: key 8C6C1EFD: public key "Launchpad PPA for Bazaar Developers" imported                                                                                                                                                                              
gpg: Total number processed: 1                                                                                                                                                                                                                            
gpg:               imported: 1  (RSA: 1)                                                                                                                                                                                                                  
thomas@daisybox:~$ gpg --export --armor D702BF6B8C6C1EFD  | sudo apt-key add -
OK                                                                            
thomas@daisybox:~$ sudo apt-get update
Hit http://fr.archive.ubuntu.com intrepid Release.gpg
....
Hit http://packages.medibuntu.org intrepid/free Sources
Hit http://packages.medibuntu.org intrepid/non-free Sources
Fetched 309B in 0s (478B/s)
Reading package lists... Done

No comments:

Post a Comment