Home » Questions » Computers [ Ask a new question ]

How to work around blocked outbound hkp port for apt keys

How to work around blocked outbound hkp port for apt keys

I'm using Ubuntu 9.10, and need to add some apt repositories. Unfortunately, I get messages like this when running sudo apt-get update:

Asked by: Guest | Views: 204
Total answers/comments: 4
Guest [Entry]

"Here's one workaround I used:

I logged onto a linux server out in the free world beyond our corporate firewall, and did this:

gpg --keyserver keyserver.ubuntu.com --recv 1DABDBB4CEC06767 && gpg --export --armor 1DABDBB4CEC06767

Then on my workstation, I ran this, and pasted the output from the above command (the public key) into the stdin, followed by control-D:

sudo apt-key add -

Then I was able to run sudo apt-get update without problems.

I still think there has to be a better way, ideally something I could script."
Guest [Entry]

"I found a neat way of doing it in a single command through port 80 which is always open for www traffic.

http://gurrier.wordpress.com/2010/10/02/downlolading-repo-keys-from-behind-a-corporate-firewall/"
Guest [Entry]

"A simple solution is:

sudo add-apt-repository --keyserver hkps://keyserver.ubuntu.com:443 some_ppa

The secure https (outgoing 443) would not be blocked by the firewall."
Guest [Entry]

"I simply use ssh to forward the port to an external host then run the apt-add-repo command.

ssh -fqTnN -D 11371 <user@host>"