apt-get behind a proxy

Question : How  to  execute  the  apt-get  behind  a  proxy ?

Answer :

Follow the steps bellow to be able to execute apt-get behind a proxy:

$ cd /etc/apt
$ sudo vi  apt.conf

and  remove   this  :

Acquire::http::Proxy "false";

add this  to the  file :

Acquire::http::Proxy "http://user:pass@proxy_host:port";


Now  export   the  proxy   line  with

export http_proxy=http://user:pass@proxy_host:port

to  make  this   command  permanent   add  it  to  ~/.bash.rc  in your  home  directory

vi ~/.bash.rc


Now  restart   the  updates :

sudo aptitude update




  • http://kannad.com Jean-Baptiste DUPONT

    Why the hell I bumped suddenly into a proxy error each time I wanted to use aptitude?
    I still wonder.
    So your stuff helped me get through the issue.
    Mine was a bit different though. I wanted to eliminate the proxy stuff.
    So instead of the Acquire you proposed, I used the one you wanted to eliminate.
    I did the same with the export http_proxy by replacing the proxy chain by false like this:
    And all work fine so far.
    Just as a curiosity, I would like to read an example with a real proxy in the text above. This would greatly help.
    Many thanks,

  • Supermanikin

    Very good! I have it done. Thank you! I have been struggling for days to find this solution :D