Multiple pbuilders setting from pbuilder User's Manual doesn't seem to work

Asked by Tong Sun

Hi,

Multiple pbuilders setting from pbuilder User's Manual doesn't seem to work for me.

The FAQ section 8 from pbuilder User's Manual (http://www.red-bean.com/doc/pbuilder/pbuilder-doc.html#ENVVARDISTRIBUTIONSWITCH) describes briefly a way to setup and use multiple pbuilder setups by creating a pbuilderrc configuration in home path ($HOME/.pbuilderrc) and using the variable "DIST" when running pbuilder or pdebuild.

----------------------------------
First, setup $HOME/.pbuilderrc to look like:

if [ -n "${DIST}" ]; then
        BASETGZ="`dirname $BASETGZ`/$DIST-base.tgz"
        DISTRIBUTION="$DIST"
        BUILDRESULT="/var/cache/pbuilder/$DIST/result/"
        APTCACHE="/var/cache/pbuilder/$DIST/aptcache/"
fi
Then, whenever you wish to use pbuilder for a particular distro, assign a value to "DIST" that is one of the distros available for Debian or any Debian based distro you happen to be running (i.e. whatever is found under /usr/lib/debootstrap/scripts).

Here's some examples on running pbuilder or pdebuild:

DIST=gutsy sudo pbuilder create

DIST=sid sudo pbuilder create --mirror http://http.us.debian.org/debian
----------------------------------

That's exactly what I did.

$ cat ~/.pbuilderrc
if [ -n "${DIST}" ]; then
        BASETGZ="`dirname $BASETGZ`/$DIST-base.tgz"
        DISTRIBUTION="$DIST"
        BUILDRESULT="/var/cache/pbuilder/$DIST/result/"
        APTCACHE="/var/cache/pbuilder/$DIST/aptcache/"
fi

DIST=oldstable

$ DIST=$DIST sudo pbuilder create --distribution $DIST --mirror http://http.us.debian.org/debian --debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg"
...
I: unmounting proc filesystem
I: creating base tarball [/var/cache/pbuilder/base.tgz]
I: cleaning the build env
I: removing directory /var/cache/pbuilder/build//20348 and its subdirectories

I.e., shouldn't the created base tarball following the BASETGZ="`dirname $BASETGZ`/$DIST-base.tgz" convention?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Best Manfred Hampl (m-hampl) said :
#1

I think you have to use

sudo DIST=gutsy pbuilder create

instead of

DIST=gutsy sudo pbuilder create

see https://wiki.ubuntu.com/PbuilderHowto#line-417

Revision history for this message
Tong Sun (suntong001) said :
#2

excellent!!!

Revision history for this message
Tong Sun (suntong001) said :
#3

Thanks Manfred Hampl, that solved my question.