when should I install "*-dev" package?

sometimes, apt-cache give "-dev" package, for example:

libdianewcanvas2     - a gtk+2 vectorial canvas with extra features
libdianewcanvas2-dev - a gtk+2 vectorial canvas with extra features

I am wondering when should I install the "*-dev" package? what is the different between libdianewcanvas2 and libdianewcanvas2-dev?


Solution 1:

Let's compare the output of apt show PACKAGENAME for the two packages. I'm not showing the full output here, just some relevant parts:

$ apt show libdianewcanvas2 libdianewcanvas2-dev

Package: libdianewcanvas2
Version: 0.6.10-5.4
[...]
Description: a gtk+2 vectorial canvas with extra features
 Dia-newcanvas is a gtk+2 vectorial widget that has got extra features as
 compared to GNOME canvas:
 .
    [...]

Package: libdianewcanvas2-dev
Version: 0.6.10-5.4
[...]
Description: a gtk+2 vectorial canvas with extra features
 Dia-newcanvas is a gtk+2 vectorial widget that has got extra features as
 compared to GNOME canvas:
 .
    [...]
 .
 This package contains the header files and static library needed for
 development of programs using dia-newcanvas.

The difference here is **This package contains the header files and static library needed for development of programs using dia-newcanvas.** and actually that is exactly what describes most *-dev packages.

To sum up, you normally only need *-dev packages to develop your own applications based on the libraries a package provides. Other than that, I see no use case where you would want to install one manually. Of course it could also always happen that some other packages you install have *-dev packages as dependency so that it ill get automatically installed.