This pertains to Ubuntu 14.04 behind a proxy server that requires authentication.

I've managed to get apt-get working via proxy. My /etc/apt/apt.conf looks like this:

Acquire::http::proxy "http://my_proxy_server:3128/";
Acquire::https::proxy "https://my_proxy_server:3128/";
Acquire::ftp::proxy "ftp://my_proxy_server:3128/";
Acquire::socks::proxy "socks://my_proxy_server:3128/";

My environment variables look the same - I have http_proxy, https_proxy, ftp_proxy and socks_proxy set.

I've a bunch of questions:

  1. This proxy server needs authentication. I have not specified username and password for apt-get. However, I can still do apt-get update and it works just fine. Why?

  2. None of the other programs work. For example, pip install would fail with the message that it can't fetch https://pypi.python.org/simple

What is the right way to set up proxy?


I installed google-chrome-stable and tried to connect to the internet. It asked me for proxy authentication, which I provided. After this step, wget and pip seem to work fine! This is really strange. I'm guessing there's some configuration that chrome does which allows the other apps to connect as well.

Now, the new question is, how do I configure it as root? for instance, I can do pip install ... and it can download the packages just fine, but if I do sudo pip install ..., it fails to connect to the pypi website.


1 Answer 1


Test this:

Open a terminal. Ctrl + Alt + T

Run it:

$ sudo -i
# nano /etc/bash.bashrc

Put the following lines in the file:

export http_proxy=http://my_proxy_server:3128/
export https_proxy=https://my_proxy_server:3128/
export ftp_proxy=http://my_proxy_server:3128/
export socks_proxy=socks://my_proxy_server:3128/

Ctrl + O, save file. Ctrl + X, close nano.

$ sudo -i
# nano /etc/environment

Put the following lines in the file


Ctrl + O, save file. Ctrl + X, close nano.

  • I already have this set.
    – Sidd
    Apr 27, 2015 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.