Search code examples
c++debianpackaginglibstdc++deb

Specifying a newer C++ standard library dependency for a Debian package


I am completely new to Debian packaging and the documentation I've found takes either the form of really-incomplete tutorials (with overly-specific examples), or encyclopaedic-style manuals (with scant examples). From these, I'm trying to piece together how to package some C++17 code -- which I do not control -- to make it easier to install downstream. The target machines run Debian Buster, whose stable GCC is v8.3. This isn't new enough, so I have to install GCC 10 from testing on the build machine.

How do I reflect the updated requirement for libstdc++ in a Debian control file? Is this enough:

Depends: libstdc++6 (>= 10.2.1)

The version here is quite arbitrary (it's one I know to work); is libstdc++6 even right? How does one indicate that this package comes from a different source?


Solution

  • It turns out that:

    Depends: libstdc++6 (>= 10.2.1)
    

    ...is enough and Apt will just complain and refuse to install until you have manually added a source that provides that package. Thanks to @KnudLarsen's comment, the actual minimum version I needed was 9.1.0.