Debian Linux: Define a system wide HTTP proxy

Hi,

to define a system wide HTTP proxy edit /etc/environment with your favourite text editor and insert the following lines


# HTTP Proxy
http_proxy=http://proxynameORipaddress:TCPPort
# If the HTTP Proxy requieres authentification
http_proxy=http://<yourProxyUserName>:<password>@<proxynameORipaddress>:<TCPPort>

# same procedure for HTTPS
https_proxy=http://proxynameORipaddress:TCPPort
# If the HTTPS Proxy requieres authentification
https_proxy=http://<yourProxyUserName>:<password>@<proxynameORipaddress>:<TCPPort>

# and for FTP
ftp_proxy=http://proxynameORipaddress:TCPPort
# If the HTTPS Proxy requieres authentification
ftp_proxy=http://<yourProxyUserName>:<password>@<proxynameORipaddress>:<TCPPort>

# For SOAP requests
soap_use_proxy=on

# Do not use a proxy for 
no_proxy=localhost,yourinternaldomain.com;

apt commands also uses the proxy defined in the environment.

When you want to configure a proxy especially for apt, create a new file 99proxy in /etc/apt/apt.conf.d/ and add

Acquire::http::proxy "http://yourProxyUserName:password@proxynameORipaddress:TCPPort";
Acquire::https::proxy "http://yourProxyUserName:password@proxynameORipaddress:TCPPort";

Have fun 🙂

Michael

Leave a Reply