Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a apt-cacher-ng server on my LAN network, and I was wondering how I could "force" pbuilder to use it (to speed up package builds).

Typical setup client-side of the cache goes something like this:

In /etc/apt/apt.conf:

Acquire::http { Proxy "http://servername:3142"; };

share|improve this question
pbuilder has a --mirror option that i guess sets the mirror to use. Try setting it to apt-cache-ng server address. – Salem Jan 17 '12 at 17:03
@Salem I don't think that'd do it, since apt-cacher-ng is just a proxy not a mirror. – jrg Jan 17 '12 at 17:07
@jrg apt-cacher-ng can run as a mirror. Simply use http://servername:3142/ubuntu as your mirror url. – xav0989 Apr 16 at 20:24

2 Answers

up vote 2 down vote accepted

Like this:

$ sudo pbuilder --login --save-after-login
# echo 'Acquire::http { Proxy "http://servername:3142"; };' > /etc/apt/apt.conf.d/02proxy
# exit
$

Alternatively, you could use the --execute option:

$ sudo pbuilder --execute /tmp/setup-apt-proxy.sh

... where /tmp/setup-apt-proxy.sh contains commands to create /etc/apt/apt.conf.d/02proxy.

share|improve this answer

If you set export http_proxy=http://your-proxy:8080/ in ~/.pbuilderrc it will use that proxy for the package downloads.

I just tried it on my setup, and it worked. As best I could tell from the internet traffic, I didn't have to download anything while running pbuilder create.

The nice thing is that this way also works when you are creating the tarball, not just after you create it and then modify it.

share|improve this answer

Your Answer

 
discard

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.