setting proxy for apt-get

James Gray james at grayonline.id.au
Thu Sep 8 12:19:23 UTC 2005


On Thursday 08 September 2005 17:49, janne.jokitalo at dnainternet.net wrote:
> Quoting "Asep Andria I.W.":
> > Hello All,
>
> Hi there!
>
> > I've just install Ubuntu 5.04 on my PC. I have a problem with apt-get.
> > How do I set the authentication for apt-get for proxy user and proxy
> > password?
>
> "HTTP URIs; http::Proxy is the default http proxy to use. It is in the
> standard form of http://[[user][:pass]@]host[:port]/."

In other words you create an /etc/apt/apt.conf file and in it you put 
something like this:

ACQUIRE {
        http::proxy "http://user:password@proxy:8080/"
}

So in the OP's case:

ACQUIRE {
 http::proxy "http://172.16.1.71:8080/"
}

Tada! :) Using HTTP proxies for apt is actually very efficient.  I have entire 
server clusters doing this and the upgrade from Woody-Sarge was slow for the 
first machine, but flew for the others.  Just make sure all machines have the 
same sources list.

BTW, I use this apt.conf method of setting proxies along with some scripts to 
setup location profiles so I can "apt-get" no matter where I am (even in our 
Windows-centric office).  Works a treat with both non-authenticating and 
authenticating proxies.  If you need to authenticate yourself with a proxy 
that expects an MS Domain, you prepend your userid with the domain and a 
back-slash, eg:
ACQUIRE {
        http::proxy "http://domain\user:password@proxy:8080/"
}

I've never got this working properly (at all) if the password contains special 
characters like !@#$%^&* etc.  I've tried escaping them with back-slashes, 
putting the whole thing in single quotes - nadda.  If anyone has a solution 
to this I'm all ears :)

HTH.

Cheers,

James
-- 
bit, n:
 A unit of measure applied to color.  Twenty-four-bit color
 refers to expensive $3 color as opposed to the cheaper 25
 cent, or two-bit, color that use to be available a few years ago.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050908/32c35870/attachment.sig>


More information about the ubuntu-users mailing list