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