Debian – Setting up Proxy Settings on Debian

debianhttp-proxyPROXY

During installation of Debian I was asked for a Standard Proxy String in the form of http://user:password@host:port/, which I entered. apt-get ran and retrieved files during update, and now Debian is installed. However, when I tried running sudo apt-get install ..., I get an error message containing the message Could not resolve proxy_host where proxy_host is the host I entered during installation.

Are there other places where I have to set up the proxy information?

Best Answer

The following is for general proxy, apt and wget and you can remove the user:password@ for a proxy that doesn't require it:

For General proxy:

touch /etc/profile.d/proxy.sh

add the following:

export ftp_proxy=ftp://user:password@host:port
export http_proxy=http://user:password@host:port
export https_proxy=https://user:password@host:port
export socks_proxy=https://user:password@host:port

For APT proxy:

touch /etc/apt/apt.conf.d/99HttpProxy

add the following:

Acquire::http::Proxy "http://user:password@host:port";

For wget:

nano /etc/wgetrc 

find and uncomment proxy lines or add them if not present

http_proxy = http://user:password@host:port
https_proxy = ...
...
Related Question