What Is Pbuilder And Why You Might Want To Use It

Pbuilder is a automated package building tool for Debian. It can build packages for any of the Debian distributions. It also handles package dependencies needed for the build automatically. It can be a very handy tool. The following is an explanation of why you might want to use pbuilder for building Debian packages.

Building Packages For Stable, Testing, or Unstable
Using pbuilder allows you to create a package for any of the Debian distributions. If you want to build a package for the stable (Currently Sarge) distribution of Debian you can use pbuilder to build the package in a stable Debian chroot. You can do the same for the testing and unstable distributions. This makes building packages for a specific Debian distribution convenient.

Chroot Builds
Pbuilder builds packages in a chroot jail. This means you do not need a seperate development machine to build packages on. All you need to do is use pbuilder to build a base tarball of the stable, testing, or unstable Debian distributions. Then you can use the tarball to build a package for whichever distribution you wish. Pbuilder will use the tarball you specify on the commandline. This keeps your package development separate from your normal system.

Dependencies
Pbuilder downloads all the dependencies that the package it is building needs automatically. This means you do not have to clutter your system with dependencies that you need just for building a particular package. Pbuilder extracts the tarball and chroots into the build environment to build each package so everything is kept in one place.

Built Packages
The packages that pbuilder builds are placed in /var/cache/pbuilder/results/ by default. This makes it very handy as all your work is in one central place. You can then copy the packages wherever you like. You can copy them to a personal repository for instance. Then you just add your repository to your /etc/apt/sources.list file. Once you have completed that you can do an apt-get update and apt-get install "yourpackagename".