How to add a ppa key if you are behind a restrictive firewall (port 11371 is blocked)

7 12 2011

Before you can begin to use an Ubuntu ppa you have to add the signing key.

The instruction on the ppa is very clear on how to do this.  (sudo add-apt-repository ppa:user/ppa-name)

The problem with this approach is that gpg will request the key over port 11371 that may be blocked by you corporate firewall. Trying to add the Firefox Stable Channel Packages (https://launchpad.net/~mozillateam/+archive/firefox-stable) with command:

sudo add-apt-repository ppa:mozillateam/firefox-stable

I get the following errors:

gpg: requesting key CE49EC21 from hkp server keyserver.ubuntu.com
gpgkeys: HTTP fetch error 7: couldn’t connect to host
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

The solution to this problem is to download the key from the ubuntu key server manually.

On the ppa page look for the key server link located under the heading “Signing key:” in the case of the firefox ppa the link was:

http://keyserver.ubuntu.com:11371/pks/lookup?search=0x0AB215679C571D1C8325275B9BDB3D89CE49EC21&op=index

Notice how the port 11371 is used ;(

Take the link and change the 11371 to 80 as shown below

http://keyserver.ubuntu.com:80/pks/lookup?search=0x0AB215679C571D1C8325275B9BDB3D89CE49EC21&op=index

Open the changed link in your browser if everything went well you should see a big heading saying “Search results for …..”

Below the heading click on the key id link (it is the first one) in the case of the firefox ppa the link was:

http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x9BDB3D89CE49EC21

You should now see a heading “Public Key Server — Get …..” with the key information below:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.0.10
...
...
...
-----END PGP PUBLIC KEY BLOCK-----

Copy the key text into a new file named key.txt and save the file. (Dont copy the page heading)

Now that you have the key open a terminal and navigate to the same directory were you key is saved. Mine was saved as key.txt in the home directory

Add the key using the command

sudo apt-key add ./key.txt

If all went well you should see the message:

OK

Now you can do the normal sudo apt-get update and sudo apt-get upgrade. Or install the software however you like.

 


Actions

Information

8 responses

8 12 2011
JonL

Very nice write-up! Seems odd to me that the keystores would chose to use a non-standard web port like this.

9 12 2011
fredreh

Thanks. Their is probably some reason I am not aware of (my knowledge of anything key related is lacking)

18 03 2013
Rajednra

Thanks. This article helped me to install ‘oracle-java7-installer’ on lucid

12 07 2013
health insurance maryland

Heya i’m for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and help others like you aided me.

13 07 2013
Guillermo

This has been really helpful. Thanks a lot!

20 11 2013
Anonymous

This quick little guide is perfect — clear and accurate (Ubuntu 12.04). Thank you for taking the time to post this.

5 02 2015
emariz

Thank you very much, mate! This eases the use of certain PPA’s in Debian- but not Ubuntu-based distributions (where the command add-apt-repository is not available.)

21 06 2017
Collin Callis

I have to show my appreciation for your generosity for visitors who require help on that subject matter. Your very own dedication to getting the solution all around had become exceptionally useful and has truly permitted guys much like me to achieve their dreams. Your own valuable report can mean a whole lot a person like me and even further to my mates. Thanks a lot; from all of us.

Leave a comment