I am developing a Rust application and I want to provide packages for Debian. I have something similar to this configuration under debian/controls

Source: com.github.yourname.yourrepo
Section: x11
Priority: extra
Maintainer: Someone
Build-Depends: cargo,
               debhelper (>= 9),
Standards-Version: 3.9.3

Package: com.github.yourname.yourrepo
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: SomeApp
Some app developed in Rust

But when I try to build it with debuild it complains that I don't have cargo. However, if I type cargo in my terminal it is present in the system. I guess the reason is that I didn't install the cargo package. And I don't want to force people to install it either, if they already have cargo. Is there a way to enforce having a dependency that is not a Debian package?

2 Answers 2


No, there is no way to enforce a build- (or other) dependency which isn’t a Debian binary package. All the dependency, conflict etc. fields declare relationships between packages.

You can cheat by using equivs to create fake packages, if you want to use your own cargo instead of the packaged one, but then you won’t be able to check that your package builds correctly for other Debian users.


Note that the Build-Depends: ... packages are only installed while building. That means end users will never see that list.

Instead, your Depends: ... is what gets automatically installed when the end users do:

apt install ./<package>.deb

So you can as well install the cargo package while building. The only reason for not doing so is if the build system cannot see a newer version of the package and that newer version is required. In that case, you'd have to create a cargo package yourself first and then use that special package in your build system (as mentioned by Stephen Kitt).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .