Where proxy.addr is the proxy address, 4040 is the port number. Some proxies may require “http://” before the address.
export http_proxy="proxy.addr:4040" export ftp_proxy="proxy.addr:4040" export https_proxy="proxy.addr:4040"
If you run this in a terminal, any programs opened from that terminal will adhere to the proxy you set but any other applications will not. This makes it useful if you just want to launch a browser for a quick browsing session but don’t need the whole system to access the internet.
If you do need your entire system to access the network, you can add these to the bottom of “~/.bashrc” this will enable any new programs running and the whole system (after a restart) to use the settings. Essentially ~/.bashrc are commands run when a terminal is opened.
NOTE: If you do this, when you remove them your machine will likely need a restart to undo the changes.
Proxy with login
If your proxy server requires a login, this is an addition of the above however the syntax is as follows:
APT (used for system updates) has its own proxy settings, which seem to ignore the above settings.
Where nano is the editor, if you prefer use a graphical one such as gedit, kedit etc.
sudo nano /etc/apt/apt.conf.d/02proxy