Submit A Tip Alternative Tip Form

How to add repositories to Ubuntu from behind a firewall

Having trouble updating Ubuntu at University? MadnessRed has the solution in this guest post.

A lot of companies and universities block all unknown ports. This usually includes the port used to add repositories to Ubuntu.

A simple work around is to ‘get’ repository keys over port 80 – a common port that is unlikely to be blocked.

I wrote a script to do this but it still takes a while as it try using the ‘unknown’ port first, which takes ages to fail.

A better solution I found it to edit the apt-add-repository script to use port 80.

  1. Press Alt-F2 and type "gksu gedit /usr/lib/python2.6/dist-packages/softwareproperties/ppa.py"
  2. Find line 88, change "keyserver.ubuntu.com" to "hkp://keyserver.ubuntu.com:80"
  3. Save and close.

Now apt-add-repository will get keys over port 80, which is not blocked.