Search code examples
clinuxgnu-coreutils

How to find the package to which a certain file belongs in a Debian-based distribution?


Where are the Gnulib files in Linux?

I want use lib like safe-read, mbchar, etc... in my project but I do not find them on my Ubuntu 11.10 machine.


Solution

  • apt-file is your friend:

    x@y:~$ apt-file search safe-read
    gnulib: /usr/share/gnulib/lib/safe-read.c
    gnulib: /usr/share/gnulib/lib/safe-read.h
    gnulib: /usr/share/gnulib/m4/safe-read.m4
    gnulib: /usr/share/gnulib/modules/safe-read
    

    Use sudo apt-get install gnulib (in this case) to install the missing dependency. Run

    sudo apt-get install apt-file
    sudo apt-file update
    

    once to initialize the file index.