In this guide, you will learn how to set proxy settings for the APT command in Ubuntu/Debian Linux distributions.
A proxy server is an intermediary server that sits between a client system or end user requesting the resource and the resource itself. In most cases, a proxy server acts as a gateway between end users and the internet.
For organizations and enterprise environments, a proxy server provides a number of benefits. It controls internet usage by blocking sites that are deemed to impact employees’ productivity. It also enhances privacy and improves the organization’s security through data encryption.
There are several ways to set proxy settings for apt command, so let’s jump right in.
Note: For demonstration, we will use Ubuntu 22.04.
### Configure Proxy Setting For APT Using A Proxy file
The easiest way to configure proxy settings for the APT command is by creating a proxy.conf file as shown.
```
$ sudo vi /etc/apt/apt.conf.d/proxy.conf
```
For a proxy server without a username and password, add the following entries as shown
Once you are done, Save the changes and exit the configuration file. The Proxy settings will come into action the next time you run the APT package manager.
For example, you can update the local package index and then install net-tools package
```
$ sudo apt update
$ sudo apt install net-tools -y
```
Verify the proxy server logs to confirm that apt command is using proxy server for downloading packages. On the proxy server run,
Save the changes and exit the configuration file. Just a reminder that these settings take immediate effect once you start using the APT package manager.
##### Conclusion
This concludes this guide. In this tutorial, we have demonstrated how you can configure proxy settings for the APT package manager which is used in Debian/Ubuntu Linux distributions. That’s all for now. Keep it Linuxechi!
Also Read: How to Install Go (Golang) on Ubuntu Linux Step-by-Step