Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using pbuilder-dist to build my packages for Debian unstable and Ubuntu Precise. I want to know how to run lintian (and possibly other commands) inside a certain chroot.

I have Ubuntu 12.04 on my machine.

share|improve this question
Lintian i think can be run as its own command, if not, then you can run it at build-time, using pbuilder to build teh source package (create the source package with debuild -S), but I'm not entirely certain, so I'm not posting this as a true answer. – Thomas Ward Jun 14 '12 at 12:00
up vote 4 down vote accepted

Lintian can be run inside cowbuilder or pbuilder using hooks. Several examples are available in /usr/share/doc/pbuilder/examples/

Just copy the hook you want to a directory:

mkdir ~/pbuilderhooks
cp /usr/share/doc/pbuilder/examples/B90lintian $HOME/pbuilderhooks

Then tell pbuilder to use the hooks in that directory:

echo "HOOKDIR=$HOME/pbuilderhooks/" >> ~/.pbuilderrc


echo "HOOKDIR=$HOME/pbuilderhooks/" | sudo tee -a /etc/pbuilderrc

The first is required if you intend to run cowbuilder-dist or pbuilder-dist without sudo; the latter if you intend to run sudo cowbuilder or sudo pbuilder. Use tee -a to avoid overwriting the original /etc/pbuilderrc file.

share|improve this answer

Running debuild -S will run lintian on the source.changes for you I believe. Lintian is also run on the .changes file during the binary build. Once you've built the binary and/or source package you can manually run lintian against either .changes file, just like this:

mfisch@caprica:~$ lintian libkqueue_1.0.4-2ubuntu1_amd64.changes


mfisch@caprica:~$ lintian libkqueue_1.0.4-2ubuntu1_source.changes

You may get different lintian errors or warnings from each build (source and binary).

If you're trying to move quicker, run pbuilder --login, install the build-deps and run your builds there, that saves you the start-up time from re-installing deps before each build.

share|improve this answer

Your Answer


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.