man apt-file (Commandes) - APT package searching utility -- command-line interface


apt-file - APT package searching utility -- command-line interface


apt-file [ options ] [ action ] [ pattern ]


apt-file is a command line tool for searching packages for the APT packaging system.

Some actions are required to run the search:

Resynchronize the package contents from their sources. The contents packages are fetched from the location(s) specified in /etc/apt/sources.list. This command attempt to fetch the Contents-<ARCH>.gz file from remote source.
Search in which package file is included. A list of all package containing the pattern pattern is returned.
List the contents of a package matching the pattern pattern. This action is very close to the dpkg -S command except the package does not need to be installed or fetched.
Alias for list.
remove all Contents-<ARCH>.gz files in cache directory.


--cache | -c cache-directory
Sets the cache directory to cache-directory instead of its default value (/var/cache/apt) thus you can use apt-file even if you do not have administrator privileges.
--verbose | -v
Run apt-file in verbose mode.
--cdrom-mount | -d cdrom-mount-point
Use cdrom-mount-point instead of apt's.
--ignore-case | -i
Do not expand pattern.
--regexp | -x
Treat pattern as a regular expression.
--version | -V
Show version number.
--architecture | -a architecture
Sets architecture to architecture. This option is useful if you search a package for a different architecture the one installed on your system.
--sources-list | -s sources.list
Sets the sources.list file to a different value its default /etc/apt/sources.list.
--package-only | -l
Only display package name. Do not display file names.
--fixed-string | -F
Do not expand search pattern with generic characters at pattern's start and end.
--dummy | -y
Run in dummy mode (no action).
--help | -h
Display a short help screen.


The apt-file configuration file (/etc/apt/apt-file.conf) changed from version 1 to version 2. Now only fetch backends are defined in the configuration file. Thus it is much easier to configure proxies.

A string expension is done on several value. See string expension section.

This variable describes how cached files will be named.
http | ftp | ssh | rsh | file | cdrom
Here are the commands used to fetch files.


A sources.list entry is defined as:

	  deb uri dist componant1 componant2 ...

an uri, is defined as:

replace with the hostname.
replace with the port number.
replace with full uri
replace with full path (relative to / on the host)
replace with distribution name
replace with component name
replace with cache directory
replace with destination expended value.
replace with cdrom-mount-point.


Locations to fetch packages contents from.
Configuration file for apt-file.


auto-apt(1), apt-cache(8), apt-cdrom(8), dpkg(8), dselect(8), sources.list(5), apt.conf(5), apt_preferences(5).

The APT users guide in /usr/share/doc/apt/


cdrom backend has not been tested.

Non-release line in sources.list is not handled by apt-file.


apt-file was written by Sebastien J. Gross <>.