Wednesday, June 3, 2009

Fix software sources bad behaviour

Every now and then you will run into the problem of not having the correct keys for the software sources that you enter into Synaptic. A lot of the time, this is because nobody bothered to give them to you, or you just haven't figured out how to request them using gpg.

This is what the error looks like:
W: GPG error: http://ppa.launchpad.net hardy Release:
The following signatures couldn't be verified because the public key
is not available: NO_PUBKEY EF4186FE247510B

Fixing this is simple. Open a terminal and replace the word KEY in both lines with the key you want to get (for example, EF4186FE247510BE). Do this for each key.

Code:

gpg --keyserver hkp://subkeys.pgp.net --recv-keys KEY
gpg --export --armor KEY | sudo apt-key add -


Then
Code:

sudo apt-get update

Works like magic. Thank you to Michy99 from Ubuntu Forums for pointing this out. I also found a method for querying keyservers and adding keys from the index the long way. The tutorial is at RebelZero.Com and it is probably more security conscious than the above method.

UPDATE: I found a one line method for rectifying the problem. A lot faster than either of the above methods.

Allaun recommends using the NO_PUBKEY value (e.g. C5E6A5ED249AD24C) to add the key with the following command.
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C5E6A5ED249AD24C

2 comments:

  1. [...] 30, 2009 in CLI, Ubuntu In Fix Software Sources Bad Behaviour we reported two methods for accomplishing the same task. The first, involved manually entering two [...]

    ReplyDelete
  2. [...] Posts Ubuntu womenIs Ubuntu Satanic version taking over?Fix software sources bad behaviourGoogle Gears on Ubuntu 64bitOpenOffice.org 3.1 For Hardy, Intrepid, JauntyUbuntu men tattooed by [...]

    ReplyDelete