0

I'm creating a deb package for the first time (using CPack, but I don't think that's relevant), and I'm confused by dependent package versioning. My application depends on 2 Boost libraries and I need a minimum of v1.71, so I thought I could just use this string:

"libboost-program_options (>= 1.71), libboost-log (>= 1.71)"

But it turns out those packages have the version in their name! So I have to use this string in order to get the package to install at all:

"libboost-program_options1.71.0 (>= 1.71), libboost-log1.71.0  (>= 1.71)"

Which renders the minimum versioning specification useless. So now if someone has v1.73 of the libraries installed, which would be perfectly fine, apt would fail to meet the dependencies!

How do 'real' package maintainers solve this problem?

2

You can use meta packages libboost-program-options-dev and libboost-log-dev.

They will pull the relevant libboost-program_optionsx.xx.x.

So the depends line will look this way:

libboost-program-options-dev (>= 1.71), libboost-log-dev (>= 1.71)
3
  • It's not great as it pulls in the source for the libraries, but it's certainly better than nothing. – cmannett85 Jul 11 '20 at 9:11
  • 1
    The problem is that there is no meta package for those without dev. There is libboost-all or something like that. But it pulls much more than you need. – Pilot6 Jul 11 '20 at 9:13
  • @cmannett85 Another option is not to specify the version at all. All 20.04 releases will have 1.71+ versions anyway. – Pilot6 Jul 11 '20 at 9:43

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.