I've been inspecting different howto's and guides on how to build packages lately. And there seems to be a lot of ways one could go about it. So I'm a bit confused about what exactly to use. That is I'm trying to see the whole picture. What tools exist? What are the relationships between them? Which are wrappers for which? Which are better suited for what? Like, apt-get source is probably mainly targeting users, not developers. Better alternative must be dget. Which are the alternatives for which? To name a few there are pbuilder, pdebuild, pbuilder-dist, cowbuilder, sbuild, debuild, dpkg-buildpackage, fakeroot. And there must be a lot more I don't even know about. What are the most common workflows?

2 Answers 2


What I managed to find out. First, there is this brief description which is what I mostly ask here.

At the core of the build system lies dpkg-buildpackages, which uses fakeroot, which in its turn runs debian/rules (which is a makefile) to bulid a package. And that might be enough if you're going to build a package for internal use for the release you're running it in.

If on the other hand you're aiming at contibuting to debian/ubuntu, you're going to use at least debuild, which runs lintian and signs the files.

If you want to target different debian/ubuntu releases, you're going to use pbuilder, which among other things builds packages in a clean environment not clobbered with your already installed packages to see the actual dependencies. One might consider using pbuilder-dist to simplify matters even more.

There's pdebuild which is said to be "pbuilder way of doing debuild". I don't see it running lintian, but that might be not in line with pbuilder way.

Then there's also cowbuilder, if you want to speed up building packages (wrapper around pbuilder?). There are also tools for building from git repositories, I haven't dug into.

UPD I'm told on #debian-mentors that "sbuild behaves the same as the buildd, less surprises", that "pbuilder's support for experimental is just wrong", that "OTOH sbuild still misses something to take away network from the build process", and that pbuilder is not maintained. Taking away network is needed since building packages should not rely on it being present, they shouldn't download anything.

schroot from experimental is supposedly able to isolate (unshare) network.

  • 1
    +1 for that link to packaging tools hierarchy, I just got some interest for this topic for few days. cowbuilder seems the easiest tool (compared to what I saw with pbuilder). I have resumed steps in this answer: askubuntu.com/questions/548815/cannot-build-on-launchpad/… . BTW, you don't have to deal with any chroot tool directly. sbuild / pbuilder take care of that.
    – user.dz
    Jan 4, 2016 at 13:34

You do not say much about your source environment.

If it is open source and just one project (one control file under the debian/ directory) then https://launchpad.net is a really good solution. More or less, you have to get the files right and they take care of the rest.

Getting the files right is a little bit of magic for me, even now, but there is a plethora of documentation on how to create a package. You could start with a very simple example that works and then take the time to add other options/features as you move forward. That way you do not have to learn all the ins and outs all at once.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .