我應該什麼時候安裝“*-dev”套件?

我應該什麼時候安裝“*-dev”套件?

有時,apt-cache 會給出“-dev”包,例如:

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

我想知道什麼時候應該安裝“*-dev”套件? libdianewcanvas2 和 libdianewcanvas2-dev 有什麼不同?

答案1

apt show PACKAGENAME讓我們比較兩個包的輸出。我在這裡沒有顯示完整的輸出,僅顯示一些相關部分:

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

這裡的差異**This package contains the header files and static library needed for development of programs using dia-newcanvas.**其實正是大多數*-dev軟體包的描述。

總而言之,您通常只需要*-dev套件來根據套件提供的庫來開發自己的應用程式。除此之外,我沒有看到您想要手動安裝的用例。當然,也可能總是會發生這樣的情況:您安裝的某些其他軟體包將*-dev軟體包作為依賴項,因此它無法自動安裝。

相關內容