Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I'm trying to use apt-get command on a network that uses a proxy, like this:

We use on port 80 as Http-proxy, and after that an authentication window comes up, asking for user name and password.

Our Username/Domain is like this:

I'm wondering, how i can use http_proxy=http://User:Pass@Proxyserver:Port in this situation!? I also tried both, and as Proxy server but no result!

share|improve this question

3 Answers 3

To use apt-get through a proxy, either make a file in /etc/apt/apt.conf.d/ called proxy or something that you'll recognise, or make (if it doesn't exist) /etc/apt/apt.conf and insert the following line:

Acquire::http::Proxy "http://username:password@proxy.server:port/";

Simply replace username and password with your login details, and replace proxy.server:port with the correct address (in your case,, so your line will end up something like this:

Acquire::http::Proxy "http://username:password@";

If you're required to use the @ symbol in your username, you'll have to escape it with a backslash (

While escaping characters by using the backlash does not work (e.g. \@ in export and wget), special characters can be escaped with URL encoding. For instance, becomes See this list of URL-encoded characters for more information.

share|improve this answer

Alternatively, you can place the following in /etc/apt/apt.conf

Acquire::http::Proxy "http://proxy.server.port:8080";

8080 is the port number and I think is standard.

Don't forget the quotes or the trailing semicolon.

share|improve this answer

This should solve your problem:

export http_proxy=http://username:password@
share|improve this answer
EXPORT HTTP_proxy=http://username:password@ run in Bash results in EXPORT: command not found. –  David Foerster May 18 at 9:36
Both export and http in lower case. Bash is case-sensitive. Else it should work. At least it has been working for me for two years. –  the_Seppi May 18 at 11:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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