Debian: HOWTO find a package containing a certain file
Debian: HOWTO find a package containing a certain file
(this example works on Debian-based systems too):
# apt-file update && apt-file search /usr/share/doc/rails/README.railties
rails: usr/share/doc/rails/README.railties
#
This example was me searching a package containing /usr/share/doc/rails/README.railties file. The result tells that rails is the package.
Well.. if the file is inside /usr/share/doc/[package name]/*, you know already that the package name is called [package name]. ;)
ReplyDeleteThe real power of apt-file is that you can simply search for the file, without the folder part, like:
$ apt-file search README.railties
rails: usr/share/doc/rails/README.railties
Didn't know this one. I had to install apt-file in Debian Lenny GNU/Linux, and know I'm waiting for it to "apt-file update".
ReplyDeleteIt might come in hand :)
If the file you're looking for belongs to a package that is installed, you can also use dpkg directly:
ReplyDelete$ dpkg -S /etc/crontab
cron: /etc/crontab
b.r.: Oops, my mistake... That was exactly the example I wanted to give :-P Thanks...
ReplyDeleteManuel: Yes, I just posted this one 'cause many people ask me how to do it with non-installed packages... But thanks anyway :-)