- - - - - yumeneru - - - - - nemuru - - - - -

Devuan/Debian Find Package Containing File

Occasionally, I need to install a package which provides a certain library or header file, and the package name isn't immediately obvious.


To find a package which provides a certain file on Devuan, or probably and Debian-derived system, you can use dpkg(1).

dpkg --search <filename>

For example, trying to find the PC(5) file for oniguruma:

$ dpkg --search oniguruma.pc
libonig-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/oniguruma.pc


An alternative that I stumbled across is apt-file(1).

$ apt-file search oniguruma.pc
libonig-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/oniguruma.pc
librust-onig-sys-dev: /usr/share/cargo/registry/onig_sys-69.5.1/oniguruma/oniguruma.pc.cmake.in
librust-onig-sys-dev: /usr/share/cargo/registry/onig_sys-69.5.1/oniguruma/oniguruma.pc.in

last updated: 2022-05-02