Home

pbuilder

pbuilder is a tool used on Debian and derivatives to build Debian packages inside a clean, isolated chroot environment. It uses debootstrap to create a minimal base system for a chosen distribution and architecture, and then runs the standard Debian packaging build process inside the chroot. This separation from the host helps ensure that build dependencies come only from declared build-dependencies, supports reproducible builds, and reduces the risk of contamination from the building machine.

How it works: A chroot is prepared for a given distribution and architecture, and the package is

Configuration and usage: Global options are defined in a pbuilder configuration file, typically /etc/pbuilder/pbuilderrc, with per-project

See also: sbuild, cowbuilder, debootstrap.

built
inside
that
environment
using
the
usual
tools
such
as
dpkg-buildpackage
or
debuild,
often
with
fakeroot
to
simulate
root
privileges.
pbuilder
can
update
the
chroot,
install
build
dependencies
automatically,
and
collect
build
logs
and
resulting
.deb
files.
To
speed
repeated
builds,
wrappers
like
cowbuilder
provide
a
copy-on-write
backend
that
reuses
a
base
chroot
across
builds.
customization
possible
via
a
local
pbuilderrc.
The
built
chroots
are
stored
in
a
cache,
commonly
under
/var/cache/pbuilder,
with
separate
bases
for
each
distribution
and
architecture.
The
user
supplies
a
source
package
(for
example
a
.dsc
file)
or
sources,
and
pbuilder
performs
the
build
within
the
prepared
chroot.
Commands
commonly
include
pbuilder
create
to
set
up
a
chroot
and
pbuilder
build
to
build
a
package.