2

I have a library and few binaries that I want to pack as Debian package. I have dependency on : libboost-log*, libprotobuf* etc.

I don't want to add dependency on dev packages "libboost-all-dev" etc and want to add dependency non dev packages. I realized by looking at the ubuntu packages archive that some of these libraries change name in different version of ubuntu:

libboost-filesystem1.65 and libboost-filesystem1.58

Do I need to create separate package for each ubuntu versions (14, 16, 18 etc)?

Also my binaries are compiled on ubuntu 18 and they get linked to latest version of boost (1.65) . When I pack and install same on older version(ubuntu 16 where version of boost is 1.58), I get error while running binary.

myprog: error while loading shared libraries: libboost_system.so.1.65.1: cannot open shared object file: No such file or directory

Is there a way I can compile by binary just on on version of ubuntu and specify dependencies in a way that package works on all ubuntu version?

1

Is there a way I can compile by binary just on one version of Ubuntu and specify dependencies in a way that package works on all Ubuntu versions?

For debs, in general, no, you can't. Dependencies shipped in Ubuntu may break ABI between releases such that a particular dependency may have no common ABI in the versions shipped between two specific Ubuntu releases.

It is necessary to manage backports individually on a per-release basis if you want to maintain backports using debs.

Embedding dependencies is a way of working around this problem. See Snaps for details. You could also do that with debs in theory, but you'll probably find the tooling around snaps (snapcraft) makes it much easier to create. Snaps are safer for users to consume, too, because they run confined.

| improve this answer | |

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.