Apt-get behind a proxy in Ubuntu 11.10

When you are behind a proxy on Ubuntu 11.10 and would like to update your system:

  1. Edit the file /etc/apt/apt.conf.d/02proxy
  2. Add the following line to this file (Of course replace the username, password and proxy ip address)
    Acquire:http:Proxy "http://username:password@proxy:80";
  3. And of you go:
    apt-get update
    apt-get upgrade

Thanks to:

If the above does not work, you could try the above in /etc/apt/apt.conf. This sometimes works with the above doesn’t.

Posted on March 3, 2012, in Linux, Oneiric Ocelot, Ubuntu. Bookmark the permalink. 2 Comments.

  1. hi my password is having an @ symbol in it ,is there any other way to represent the @ symbol of my password in the apt.config file

  2. jeroencoenders

    @vicky I am not completely sure of this, I have never tried it and I do not have a proxy with which I can try, but it might work if you put your username and password in single quotes, so something like this:
    Acquire::http:Proxy “http://’username’:’password’@proxy:80”;

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: