I'm currently behind a proxy at my university. I can access the www on this computer by changing chromium's proxy settings.

I can also use the command line apt-get only by running this function each time:

function uniproxy()
  read -s -p ">> " mypassword
  export http_proxy=http://myusername:$mypassword@wwwproxy.stuff.is.here:8000
  export https_proxy=http://myusername:$mypassword@wwwproxy.stuff.is.here:8000
  export ftp_proxy=http://myusername:$mypassword@wwwproxy.stuff.is.here:8000
  echo ""

When I change preferences>networks proxy appropriately, it won't let me use command-line apt-get. More importantly though, update manager cannot connect even when I change the aforementioned settings. I also changed the synaptic settings to see if that would help, but alas - update manager won't connect.

How can I resolve this?

  • I'm wondering if there's a bug in 11.04 to do with this as I was able to use the apt.conf and the 'Apply System Wide' button in the GUI proxy settings panel previously but now nothing works (except the command line solution you've given in the question) – MattSmith Oct 3 '11 at 23:40
  • Weird: I rebooted and the changes to the proxy settings for Update Manager started working – MattSmith Oct 5 '11 at 3:22

Try creating a file /etc/apt/apt.conf with the following contents:

Acquire::http::Proxy "http://myusername:$mypassword@wwwproxy.stuff.is.here:8000";

That should work for any apt invocation, whether it is through the command line, synaptic or update-manager.

| improve this answer | |
  • I just gave this a shot, but no dice :(. – oadams Apr 3 '11 at 0:09
  • It changes it so I don't have to use the uniproxy function when i use command line apt-get, but the GUI stuff still won't work. – oadams Apr 7 '11 at 4:04
  • Thank you very much. It just solved the GUI problem also and I upgraded to ubuntu 11.04. – user13791 Apr 7 '11 at 12:46
  • This worked for me on Ubuntu 11.04. It looks like this should be the accepted answer. – Daryl Spitzer May 24 '11 at 18:34
  • James, where would we find documentation to explain why/how this works? – Daryl Spitzer May 24 '11 at 18:34

After editing /etc/apt/apt.conf as per James' suggestion, run sudo apt-get update in a terminal.

This worked for me. Admittedly I have no idea why.

Also, I found apt-config dump to be useful at catching syntax errors in the apt.conf file.

| improve this answer | |

I had this problem, I resolved it by clicking the "Apply system-wide" button on the proxy settings in System Settings. The apply button isn't that noticeable.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.