Skip to content

Instantly share code, notes, and snippets.

@junaidk
Last active June 1, 2017 11:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save junaidk/8827646 to your computer and use it in GitHub Desktop.
Save junaidk/8827646 to your computer and use it in GitHub Desktop.
Ubuntu Proxy

Proxy Setting for Apt is needed for us who work behind proxy. It is needed for ubuntu update, package installation, and ubuntu upgrade. This proxy setting used by apt can be configured with apt.conf and if it’s not configured ubuntu will use or read proxy configuration environtmen. read this post setting proxy bactrack or ubuntu to set proxy environtmen. On ubuntu 10.04 we can find apt.conf in /etc/apt, but on ubuntu 11.04 i can’t find this file. Reading from some articles i found out that ubuntu 11.04 will still read apt.conf configuration if this file is exist. so i just create file apt.conf in /etc/apt/

  1. Create apt.conf nano /etc/apt/apt.conf

  2. Insert folowing line in this file

Acquire::http::proxy "http://proxyserver:port/";
Acquire::ftp::proxy "ftp://proxyserver:port/";
Acquire::https::proxy "https://proxyserver:port/";

change the proxy server and port to your own proxy setting, for example :

Acquire::http::proxy "http://127.0.0.1:3128/";
Acquire::ftp::proxy "ftp://127.0.0.1:3128/";
Acquire::https::proxy "https://127.0.0.1:3128/";

or if with username and password

Acquire::http::proxy "http://username:password@proxyserver:portnumber/";
Acquire::ftp::proxy "ftp://username:password@proxyserver:portnumber/";
Acquire::https::proxy "https://username:password@proxyserver:portnumber/";

for example :

Acquire::http::proxy "http://george:asdft432@cache.campus.com:8080/";
Acquire::ftp::proxy "ftp://george:asdft432@cache.campus.com:8080/";
Acquire::https::proxy "https://george:asdft432@cache.campus.com:8080/";

make sure your password does not have @ sign in it

source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment