Ubuntu / Linux news and application reviews.

[Debian / Ubuntu] apt-file helps you find a particular file if you have to... say, finish a compilation and you don't know which package it is contained in or just want to know where to find a certain file which is part of a package you installed.

Unlike apt-cache, you can search in which package a file is included or list the contents of a package without installing or fetching it.

To install apt-file, runt this in a terminal:
sudo apt-get install apt-file

Then, before using it you must run the following command:
apt-file update

And this is how to use it:
apt-file [options] action [pattern]

Configuration options:
--sources-list -s <file> sources.list location
--cache -c <dir> Cache directory
--architecture -a <arch> Use specific architecture
--cdrom-mount -d <cdrom> Use specific cdrom mountpoint
--package-only -l Only display packages name
--fixed-string -F Do not expand pattern
--ignore-case -i Ignore case distinctions
--regexp -x pattern is a regular expression
--verbose -v run in verbose mode
--dummy -y run in dummy mode (no action)
--help -h Show this help.
--version -V Show version number

update Fetch Contents files from apt-sources.
search <pattern> Search files in packages
list <pattern> List files in packages
purge Remove cache files


apt-file example