Set System Proxy on Ubuntu

 How To Set System Proxy on Ubuntu 20.04

If you are a new user of ubuntu and in your organization a proxy server for internet access. you need to set proxy in your ubuntu operating system use the following steps.

In Ubuntu operating systems, there are various option to configuring Proxy settings. The graphical interface can be used, or all settings are done on the command line.

If you need to set proxy in Firefox browser, click on Menu > Preferences > Network Settings > check the box "Manual Proxy configuration". and check the box also use this proxy for FTP and HTTPS click on OK.

Set System Proxy on GUI

1.Open Settings.

2. On Network options, edit Network Proxy settings.

3. On Network proxy select Manual and set the proxy with port for all options.

Set System Proxy settings using CLI

This will ensure the settings apply to all logged-in users. For the system proxy settings use command

sudo nano  /etc/profile.d/proxy.sh

Set the value and save the file using ctrl +x and press y.

Add other IPs if you want to exclude from proxy to NO_PROXY & no_proxy environment variable.

execute following command.

Type command sudo chmod +x  /etc/profile.d/proxy.sh and press enter. 

Type command source /etc/profile.d/proxy.sh and press enter. 

Type command env | grep -i proxy and press enter. 

Set proxy for APT package manager

The above mention settings will work for Applications and command-line tools. If you want to set proxy only for the APT package manager. use the following steps.

Type command sudo nano /etc/apt/apt.conf.d/proxy and press enter.

Set the value and save the file using ctrl +x and press y.

Acquire::http::proxy "";
Acquire::https::proxy "";
Acquire::ftp::proxy "";

Replace with your proxy server IP address. If Authentication is required, use the following steps and type username and password.

Acquire::http::proxy "http://<username>:<password>@<proxy>:<port>/";
Acquire::https::proxy "https://<username>:<password>@<proxy>:<port>/";
Acquire::ftp::proxy "ftp://<username>:<password>@<proxy>:<port>/";

Set Proxy for wget only

first install vim using command sudo apt install vim and press enter.

For set the proxy settings for use with wget command, add them to ~/.wgetrc file.

Press i for insert the value, type the value and save the file using ESC :wq

use_proxy = on
http_proxy = 
https_proxy = 
ftp_proxy =

Post a Comment