Debian – Conditional dependencies for a Debian package

debiandependenciespackage-management

I am creating a package that needs to depend on a package if another is installed, but needs a different dependency if no such package is installed. Is that possible using just the control file of the .deb, or are other tools needed? This package is actually meant for Ubuntu, so any tools unavailable in Ubuntu repositories can't be used.

Best Answer

The control file is static so no you can't change dependencies on some external parameters but the Debian Policy specifies | as a way to specify alternative package names, in your case it would be something like:

Depends: Package1 | Package2

where Package1 is the default dependency.

Related Question