14

I've a problem at the office. We're behind a proxy (which is set and applied at ubuntu proxy settings) and when I try to add a repository from terminal, I get:

Error reading --some url here--: urlopen error [Errno 113] No route to host

I've tried with

  • Launchpad-getkeys script. I get this (image)

enter image description here

  • I've tried with another "hack", without luck

    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, close and reboot.

Does anyone know if I could solve this problem in any way? Thanks

Jorge Castro
  • 73,717
Enrique
  • 339

4 Answers4

14

Your issue is described on this following bug report, It seems that the proper fix is described at commment #11:

  1. Set the variable https_proxy to your proxy
  2. Edit /etc/sudoers or the correct file in /etc/sudoers.d/ so it contains:

    Defaults env_keep = https_proxy
    
Eric Carvalho
  • 55,453
João Pinto
  • 17,323
1

The script you've mentioned - launchpad-getkeys now has proxy support.

Alin Andrei
  • 7,358
1

Use the -HE option of sudo:

sudo -HE apt-key [...]

It will keep your proxy settings

user4780495
  • 271
  • 2
  • 7
0

You have to enter the root account and add the repository from there:

sudo su
add-apt-repository ppa:xxxyyy/ppa
waweru
  • 231
  • 1
  • 4
  • 7