I'm testing a new locale-all package for my system, which comes with the drawback that the source is the gigantic glibc package. I'm estimating at least 1 hour for it to build, when the package I need is not even architecture dependent. Is there a way to build only that package or at very least only the arch-indep packages?

1 Answer 1


Use dpkg-buildpackage -A (thanks, @WouterVerhelst)

-A Specifies a binary-only build, limited to architecture independent packages. Passed to dpkg-genchanges.

Also try dpkg-buildpackage -T binary-indep

-T target - Calls debian/rules target after having setup the build environment and stops the package build process here.

Debian Policy Manual says:

binary (required), binary-arch (required), binary-indep (required)

The binary target must be all that is necessary for the user to build the binary package(s) produced from this source package. It is split into two parts: binary-arch builds the binary packages which are specific to a particular architecture, and binary-indep builds those which are not.

Some source packages (for example apt) have rules for building a specific package. So, you can run dpkg-buildpackage -T apt-doc --as-root to build only apt-doc package.

  • 1
    There is also dpkg-buildpackage -A, which is meant specifically for binary-indep packages. It works even if there is no binary-indep target (which is required today, but this wasn't always the case). Oct 16, 2015 at 11:51
  • @WouterVerhelst, thanks for the info. dpkg-buildpackage -A runs dpkg-source --before-build, clean, build-indep, binary-indep, dpkg-genchanges -A, dpkg-source --after-build. This is the right answer:) Oct 16, 2015 at 18:17
  • Updated my answer Oct 16, 2015 at 18:28

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.