Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
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
add comment

2 Answers

up vote 3 down vote accepted

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
Desired=Unknown/Install/Remove/Purge/Hold
| 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).

share|improve this answer
add comment

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).

share|improve this answer
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.