9

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?

oadams
  • 1,301
  • 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 03 '11 at 23:40
  • Weird: I rebooted and the changes to the proxy settings for Update Manager started working – MattSmith Oct 05 '11 at 03:22

3 Answers3

8

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.

  • I just gave this a shot, but no dice :(. – oadams Apr 03 '11 at 00: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 07 '11 at 04:04
  • Thank you very much. It just solved the GUI problem also and I upgraded to ubuntu 11.04. –  Apr 07 '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
  • For those who don't pay attention: $mypassword is a variable, so if one would not use a variable they should not use the $ sign. @James Henstridge, I suggest that you emphasize that it's a variable name, or careless people like me who look directly at the answer my miss this point (as trivial as it may be). – Albus Dumbledore Jul 25 '13 at 14:03
1

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.

Mike B
  • 161
1

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.

Steve
  • 11