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?


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).


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_*
  • 2
    I got dpkg-buildpackage: unknown option or argument --preserve-envvars=CCACHE_* but I removed that option, seems to work ok without it Oct 15 '13 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.