Tuesday, February 28, 2012

How to locate a package that provides a specific file

It happens usually that I need a specific file and I have to find out which package provides it. Some package managers, such as yum (Fedora, Red Hat and its derivatives) and urpm (Mandriva, Mageia, blackPanther OS), have built-in action for that purpose. Aptitude and apt-get do not have. :( There are, however, some tools in Debian that search in the content of any packages. dpkg -S, e.g., does that job, however it works only for packages already installed on your system. Other tools, such as apt-file and wajig does not have this limitation. Because of some reason, I prefer apt-file. So, let's see how it works.