Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Can't add apt repository behind proxy

  1. #1
    Join Date
    May 2007
    Location
    NY, USA
    Beans
    96
    Distro
    Ubuntu 11.04 Natty Narwhal

    Question Can't add apt repository behind proxy

    My machine is sitting behind an HTTP proxy. I have apt-get, aptitude, etc., all working by setting http_proxy in wgetrc and in apt.conf. But when I try to add a repo using add-apt-repository, it fails with "Connection Refused", whether I try as myself with sudo or as root. I've also tried explicitly exporting http_proxy before running the command, but it doesn't help:
    Code:
    # export http_proxy=http://my.proxy.host:port
    # add-apt-repository ppa:freenx-team
    Error reading https://launchpad.net/api/1.0/~freenx-team/+archive/ppa: <urlopen error [Errno 111] Connection refused>
    I think I've already covered all the information given here:
    https://help.ubuntu.com/community/AptGet/Howto

    What else can I try?

  2. #2
    Join Date
    Oct 2009
    Location
    Elgin, IL USA
    Beans
    2,948
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Can't add apt repository behind proxy

    Did you try setting System > Preferences > Network Proxy? That is where you would set a general proxy instead of having to set it in each application. See if or what that sets in env.

    Otherwise, all env variable "names" seem to be capitalized, so maybe try export HTTP_PROXY=...

  3. #3
    Join Date
    May 2007
    Location
    NY, USA
    Beans
    96
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Can't add apt repository behind proxy

    Hi efflandt,
    Quote Originally Posted by efflandt View Post
    Did you try setting System > Preferences > Network Proxy? That is where you would set a general proxy instead of having to set it in each application. See if or what that sets in env.
    Yes; in my system-wide prefs, I have all protocols set to the same proxy, so this sets a bunch of *_proxy env values.

    Otherwise, all env variable "names" seem to be capitalized, so maybe try export HTTP_PROXY=...
    True that most system-wide variables have caps names, but not always the case with proxy stuff, it seems. At any rate, exporting HTTP_PROXY with my proxy value didn't work either. I saw also a value called ALL_PROXY, and tried setting that (lowercase as well as upper), but no luck.

  4. #4
    Join Date
    Nov 2007
    Beans
    5

    Re: Can't add apt repository behind proxy

    Same Problem

  5. #5
    Join Date
    Nov 2010
    Location
    Austin, TX, US
    Beans
    1
    Distro
    Ubuntu

    Re: Can't add apt repository behind proxy

    System > Preferences > Network Proxy sets all the *_proxy environment variables that most apps use. However, the APT system often runs outside your user environment and needs to be configured separately. Seemingly from your experience, some APT programs don't exactly use those environment variables.

    I suggest adding the following to /etc/apt/apt.conf.

    Code:
    Acquire::http::Proxy "http://my.proxy.host:port";
    Ref. http://manpages.ubuntu.com/manpages/...pt.conf.5.html

    Annoyingly, it seems the 10.10 desktop installer no longer has the capability to configure an network proxy and, thus, create /etc/apt/apt.conf for you.

  6. #6
    Join Date
    May 2007
    Location
    NY, USA
    Beans
    96
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Can't add apt repository behind proxy

    Quote Originally Posted by KernelKludge;10072391I suggest adding the following to /etc/apt/apt.conf.

    [CODE
    Acquire::http:roxy "http://my.proxy.hostort";[/CODE]

    Ref. http://manpages.ubuntu.com/manpages/...pt.conf.5.html
    Thanks, but I tried that from the beginning (see 1st post). Doesn't help at all.

  7. #7
    Join Date
    Apr 2009
    Beans
    24
    Distro
    Ubuntu

    Re: Can't add apt repository behind proxy


  8. #8
    Join Date
    May 2007
    Location
    NY, USA
    Beans
    96
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Can't add apt repository behind proxy

    Quote Originally Posted by mahdif62 View Post
    Hmmm ...
    Code:
    $ sudo gpg –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys 0A5174AF 
    gpg: WARNING: unsafe ownership on configuration file `/home/me/.gnupg/gpg.conf'
    usage: gpg [options] [filename]

  9. #9
    Join Date
    Apr 2007
    Beans
    11

    Re: Can't add apt repository behind proxy

    Quote Originally Posted by deesto View Post
    Hmmm ...
    Code:
    $ sudo gpg –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys 0A5174AF 
    gpg: WARNING: unsafe ownership on configuration file `/home/me/.gnupg/gpg.conf'
    usage: gpg [options] [filename]
    Just remove the sudo and change –keyserver and –recv-keys to --keyserver and --recv-keys.
    Code:
    gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0A5174AF
    Stupid Encoding!

    However for me this doesn't fix the problem:
    Error reading ..... <urlopen error [Errno 111] Connection refused>
    Ciao Epraim
    Last edited by T.Ephraim; May 24th, 2011 at 10:01 AM.

  10. #10
    Join Date
    Apr 2007
    Beans
    11

    Re: Can't add apt repository behind proxy

    Finally!

    you need to set httpS_proxy via
    Code:
    export https_proxy=....
    only set http_proxy is not enough.
    And I needed to execute the add-apt-repository command as root, NOT via sudo.

    Code:
    sudo su
    add-apt-repository ppa:........
    Ciao Ephraim

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •