I was trying to get updates to my Linux installation with apt-get but it didn’t work right away
because I was behind a proxy/firewall so I had to tell apt-get to use proxy but how? There is no parameter on apt-get
where you can tell it to use proxy server? So we just have to use environment variables and tell our Linux that http_proxy and https_proxy should use proxy server which will be found on this and that address like this:
For http traffic:
export http_proxy='http://our.secret.proxy:8080'
For https traffic:
export https_proxy='http://our.secret.proxy:8080'
After this all http and https traffic goes through our.secret.proxy and use port 8080 after this apt-get works perfectly.
Bur probably the right way to get apt-get work with proxy is to edit /etc/apt/apt.conf file and add there line:
Acquire::http::Proxy “http://server:port″;
Thank to Anonymous about this one.
Thank you. That is actually the right way to add proxy for apt-get so I will add that to my blog post ASAP.
In fact there is a way to operate behind proxy w/o env variables.. Add this to /etc/apt/apt.conf: Acquire::http::Proxy “http://x.x.x:3081”;
HTH