I always need to search how to solve the issue to get wget and apt-get working through a proxy server, therefore I’m posting it here.

On the prompt enter:

export http_proxy="http://<proxy server hostname>:<port>/" 

Replace <proxy server hostname> with the hostname of the proxyserver (eg: mickey.localdomain.local)
Replace <port> with the port the proxy uses (most common is port 8080)

If you need to login to your proxy use:

export http_proxy="http://<user>:<password>@<proxy server hostname>:<port>/" 

Replace <username> with your username
Replace <password> with your password

You can also set a proxy for ftp, gopher and wais
Here are some examples:

http_proxy="http://your.proxy.server:8080/";   export http_proxy
ftp_proxy="http://your.proxy.server:8080/";    export ftp_proxy
gopher_proxy="http://your.proxy.server:8080/"; export gopher_proxy
wais_proxy="http://your.proxy.server:8080/";   export wais_proxy

If you need to connect to host without connecting through the proxy you can use the no_proxy variable

export no_proxy=",localdomain"

This will set an exception for and the local domain named:localdomain

After a logoff or reboot the settings you just did will be forgotten to solve this you can enter the commands in the file /etc/profile.


Another way is to put everything in a script and run that script at login.