How to Set the Proxy for APT on Ubuntu 18.04

Overview

Creating an Apt Proxy Conf File

sudo touch /etc/apt/apt.conf.d/proxy.conf
sudo vi /etc/apt/apt.conf.d/proxy.conf
Acquire::http::Proxy “http://user:password@proxy.server:port/";
Acquire::https::Proxy “http://user:password@proxy.server:port/";

Simplifying the Configuration

Acquire {
HTTP::proxy "http://127.0.0.1:8080";
HTTPS::proxy "http://127.0.0.1:8080";
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store