Ubuntu - How to perform updates through a proxy

Ask a question

Ubuntu - How to perform updates through a proxy


Issue

The Synaptic Package Manager allows you to install and upgrade software packages on Ubuntu. If you are using the internet via a proxy, you will have to enable proxy support feature of Synaptic, to be able to download the latest security updates.

Enabling proxy support on Synatics

  • Launch Synaptic.
  • Click on the Settings menu > Preferences.
  • Go to the Network tab.
  • Enter the address and port of the proxy.
  • Click on Validate.

Using a proxy with apt-get and aptitude

Method 1 - configure the http_proxy

  • Open the /etc/profile for editing:
    • gksudo gedit/etc/profile
  • Add the following line:
  • Replace: the proxy.myISP.com:3128 by the address and port number of the proxy that you want to use.
  • If your proxy requires a password, use the following notation:
    • http://login:password@proxy.myISP.com:3128 

Method 2: Configure apt

  • Create a configuration file to "force" the use of the proxy:

sudo echo 'Acquire::http::Proxy "[http://proxy.myISP.com:3128]";' > /etc/apt/apt.conf.d/proxy
  • Replace: the proxy.myISP.com:3128 by the address and port number of the proxy that you want to use.
Jean-François Pillou

CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Learn more about the CCM team