Which package does this file belong to?

Need to know where a library or other file came from? Here are some I’ve used:


# rpm -qf /path/to/file



apt-file search /path/to/file

You may need to install by doing this (as root):

# apt-get install apt-file
# apt-file update


If you are using the new pkgng:

pkg which /path/to/file

or if you are still using the old pkg_ tools:

# pkg_info -W /path/to/file


Gentoo / Funtoo

# equery belongs /path/to/file


Your distribution not included here? Usually you can just do a web search for something like “redhat which file package belong” without quotes to find it for a particular distro.