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.

 

Advertisement

Actions

Information

2 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)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.