Is it possible to create a dependency for the debian version in a .deb package?

I would like to put two versions of one package into the same repository. One is for debian 5 and one for debian 6. The version numbers are different (deb 6 version has a higher number), but I would like to avoid accidental installs of the deb 6 version on deb 5 systems.

  • 1
    As long as the dependencies are satisfied, why does it matter? This is not normally done, and that is why. If you want to have different apt urls/sources for different Debian releases in an apt repos, that is fine, but it is not necessary to have different packages for that to work. – Faheem Mitha Mar 17 '11 at 6:23
  • @Faheem It matters since technologies change and even though the dependencies are satisfied, the deb 6 version won't work on deb 5 and vice versa. – Let_Me_Be Mar 17 '11 at 11:01
  • having difficulty parsing that. The dependencies are satisfied but the program won't work? What kind of program is this, if you don't mind me asking? – Faheem Mitha Mar 17 '11 at 11:59
  • @Faheem Grid software (Torque). – Let_Me_Be Mar 17 '11 at 12:49
  • Is it clusterresources.com/products/torque-resource-manager.php? Must be pretty exotic. I've never before heard of such a scenario. – Faheem Mitha Mar 17 '11 at 15:26

I don't have an actual Debian machine here, but the same mechanism should work.

jinx:1467 Z$ dpkg-query -S /etc/debian_version
base-files: /etc/debian_version
jinx:1468 Z$ dpkg-query -l base-files
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                Version             Description
ii  base-files          5.0.0ubuntu20.10.04 Debian base system miscellaneous files
jinx:1469 Z$ _

So, as a first cut, you should be able to depend on a specific version of the base-files package. You can map releases to version numbers on http://packages.debian.org, but in this case you already have the versions: they're the same as the Debian releases (5 vs. 6; ignore point releases for this comparison).


I don't think you can make a Debian package depend on a specific Debian release. A workaround for the Debian 6 package is to make it depend on a package version that is not available on Debian 5. For example, make it depend on libc6 > 2.7 (here's a page that shows which versions of that package is in which Debian suite/release).

  • 1
    Better, declare the package's actual versioned dependencies on whatever software you need from Debian 6. – Gilles Mar 16 '11 at 21:47
  • @Gilles: Why is that better? What if the dependencies are the same between the two versions of the special package? – Tshepang Mar 16 '11 at 21:50
  • 1
    I think Gilles means that if the dependencies are satisfied, then it doesn't matter which release you install it on. That also corresponds to typical usage in practice. – Faheem Mitha Mar 17 '11 at 6:24
  • @FaheemMitha: I didn't even think that far. – Tshepang Mar 17 '11 at 6:47

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.