Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 building a new .deb and want to fix lintian errors in the packaging. However, every time I rebuild, the rules file does a 'make clean' and thus starts compiling again.

Is there a way to instruct the build process that I do not want to recompile, that I'm just altering the packaging, and using the last set of binaries will be fine for now?

share|improve this question
up vote 15 down vote accepted

That depends on how you're building the package. dpkg-buildpackage doesn't call the clean target if you pass it the -nc option. Another useful option for test build is -uc (don't sign the changes file). debuild inherits these options from dpkg-buildpackage.

For a test build, you can simply do fakeroot debian/rules binary (adjust the target as appropriate for a multiple-binary package).

share|improve this answer
-nc is spot on. Thanks! – crb Aug 22 '10 at 19:01

Using ccache, you can build the package as normal, without actually recompiling unchanged source files.

ccache works by storing old results of compilations, and only rebuilds if the source actually changed.

debuild --prepend-path=/usr/lib/ccache --preserve-envvars=CCACHE_*
share|improve this answer
I got dpkg-buildpackage: unknown option or argument --preserve-envvars=CCACHE_* but I removed that option, seems to work ok without it – Dave Butler Oct 15 '13 at 15:12

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.