setting proxy for apt-get

Peter Simpson ubuntu at petethetree.co.uk
Thu Sep 8 12:35:43 UTC 2005


On Thursday 08 Sep 2005 13:19, James Gray wrote:
> 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

I presume that you must URL-encode the characters.

e.g. a space would become %20

What do you think?

Cheers,




More information about the ubuntu-users mailing list