Sunday, December 26, 2010

[kr-en03] Using wget and apt through proxy

A lot of times is necessary to download some file or source code from command line, in a remote sever wich have access to Internet through proxy server, using commands such as wget and apt, in a distro like Debian.

Setting the HTTP_PROXY variable value were usefull in order to download a file using wget, but it wasn´t the same for apt.
# export HTTP_PROXY="http://proxyserver.com:port"

In some case, previous instruction didn´t work, for that reason we recommend to use next command line
# wget --execute=http_proxy=proxyserver.com:port http://download.com/archivo.tar.gz

Adding a file named proxy in the apt.conf.d dir, work out for apt package manager
# vim /etc/apt/apt.conf.d/proxy
Acquire::http::Proxy "http://proxy.server.here:8080/";

0 comentarios: