In case you need to download GPG keys, and you have some Firewall ou Proxy behind you. In the proxy case you can do the following.

Set Proxy

Check if and are available.

$ ping -c 3
$ ping -c 3

Define http_proxy and ftp_proxy environment vars

$ export http_proxy=""
$ export ftp_proxy=""

Download Keys

In this case the keyserver is, and keyhash - 6A423791

$ gpg --keyserver --recv-key 6A423791
$ gpg --fingerprint 6A423791
$ gpg --armor --export 6A423791| apt-key add -
$ sudo apt-get update

If you are behind a restricted Firewall:

Use TCP port 80 instead of 11371

$ apt-key adv --recv-keys --keyserver hkp:// fingerprint


$ wget -O - | sudo apt-key add -
$ sudo apt-get update


Firefox -> Edit -> Preferences -> Advanced -> Network -> Settings -> manual proxy configuration

HTTP Proxy: port: 3128
select Use this proxy for all server protocols

Download the key

Go to System -> Administration -> Software Sources -> Authentication -> Import Key File -> select archive.key
System -> Administration -> Synaptic -> Reload

Practical Example

I need to install RVM (Ruby Version Manager), and I did it this way.

$ gpg --keyserver hkp:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$ curl -sSL | bash -s stable