How to use the Debian apt command over the Internet through a proxy.
If you wish to use the apt-get command on Linux and you are behind a proxy like at a college, then this simple tweak will take care of this issue. Use the sudo touch /etc/apt/apt.conf command to create the apt configuration file and then add this line to it and edit it with your proxy details. Then the apt-get command will work perfectly.
The line to add to /etc/apt/apt.conf.
Acquire::http::proxy "http://Myusername:[email protected]:8080/";
Another way is to set the proxy temporarily at the command line like this in an environment variable. This will be lost when the terminal window is closed.
export http_proxy='http://Myusername:[email protected]:8080/'
This will set the http_proxy environment variable to the value defined above and the sudo apt-get command will then work. I tried this on Linux Mint 15 and I did not need to set the http_proxy value as root.
How to set the proxy settings for YUM on Centos: https://www.centos.org/docs/5/html/yum/sn-yum-proxy-server.html.
How to enable the proxy for OpenSUSE: http://www.securitronlinux.com/bejiitaswrath/how-to-enable-the-http-proxy-in-opensuse-12-3/.
Proxy support for Mandriva Linux: http://wiki.mandriva.com/en/Development/Howto/Proxy_Support.
How to add the proxy settings on FreeBSD 10.0.
If you are using FreeBSD 10.0 and the tcsh shell; use this command to enable the proxy.
setenv http_proxy 'http://John.Smith:[email protected]:8080/'
I just used this in VMware and it worked a treat.