Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

3 Answers

up vote 7 down vote accepted

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.

share|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
show 1 more comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

protected by Community Feb 13 '12 at 12:20

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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