14

I'm tring to add a keys (on Kubuntu 12.04)

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys SOMEKEY

and I constantly get

gpg: requesting key 8AC93F7A from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error

I thought my ports are closed. But the following should have made ports 80 and 11371 open:

iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 11371 -j ACCEPT

But I still get timed out.

Edit:

The following solves it:

sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys SOMEKEY
4
  • What version of Ubuntu is this? You need to add that so we can help you. May 10, 2012 at 10:41
  • Kubuntu 12.04. I had the same problems in 11.10 and 11.04
    – Adobe
    May 10, 2012 at 10:43
  • I added the tags and edited your question with the info. May 10, 2012 at 10:47
  • @Adobe To mark this question technically 'answered'; Kindly add an 'answer' and 'accept' it. You may need to wait a day or two to be able to accept your own answer,though.
    – Mahesh
    May 10, 2012 at 11:53

5 Answers 5

20

The following solves it:

sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys SOMEKEY

If you see something like this:

W: GPG error: http://archive.canonical.com jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 

then add the appropriate key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 

You can get a list of repos here: http://repogen.simplylinux.ch (but it is not recommended to add x-org updates - at least be sure to back up You xorg.conf)

If see errors from previous repos - empty your /etc/apt/sources.list.d dir.

6

This saved my life behind corporate proxy, hope it helps you too:

sudo apt-key adv --keyserver-options http-proxy="http://<username>:<password>@<proxy_server_addr>:<proxy_port>" --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys <key_to_import>
0
0

What helped me:

sudo -E apt-key adv --keyserver-options http-proxy="http://<username>:<password>@<proxy_server_addr>:<proxy_port>" --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys <key_to_import>
2
0

Converting the server name to a proper URL as below worked for me.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys SOMEKEY

0

For me, i removed my custom /etc/apt/source.list (which not including the official ubuntu source) and recovered the origin default one back. And that it done!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .