I use mk-build-deps
from the devscripts
package for this (you’ll also need equivs
).
mk-build-deps
will build a package depending on all the build-dependencies in the debian/control
control file; that package can then be installed using apt
, which will also install all the missing dependencies.
The advantage of this approach is that uninstalling the dependency package, once you’ve finished with it, will also identify any build-dependencies which could also be uninstalled.
To reduce manual steps, the following command can be used:
mk-build-deps --install --root-cmd sudo --remove
The end result of this is that all the build dependencies are installed, but not the newly-generated build-dependency package itself: it’s installed (--install
), along with all its dependencies, and then removed (--remove
), but the dependencies are left in place.