Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
    
What version of Ubuntu is this? You need to add that so we can help you. – Svetlana Belkin May 10 '12 at 10:41
    
Kubuntu 12.04. I had the same problems in 11.10 and 11.04 – Adobe May 10 '12 at 10:43
    
I added the tags and edited your question with the info. – Svetlana Belkin May 10 '12 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 '12 at 11:53
up vote 15 down vote accepted

The following solves it:

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

If You see smth 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 

add the appropriate key:

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

(You can list all the bad keys You have)

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.

share|improve this answer

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>
share|improve this answer
1  
Just saved my life too! Thanks – Alexandre Neto Aug 3 '15 at 12:22

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>
share|improve this answer
    
Same answer as askubuntu.com/a/591824/175814 – David Foerster Apr 1 at 4:32
    
the diff is sudo -E perhaps is worth noting that I am using accessing the PC remotely - X11 forwarding over ssh – Tomasz Janicki Apr 2 at 9:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.