apt-file is a command line tool for searching packages for the APT packaging system.
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.
Install apt-file in debian
#apt-get install apt-file
this will install the apt-file package now.
Once installed you'll need to download the actual data which it uses to search. This can be accomplished with the following command otherwise apt-file search command won't return any results.
Once you've downloaded data you can now proceed to searching for packages.
#apt-file [options] action [pattern]
--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
You can also use one of the following commands to Finding which package contains a file.
#dpkg -L <package name>
fast alternative to dpkg -L and dpkg -S
uses GNU locate to greatly speed up finding out which package a file belongs to (i.e. a very fast dpkg -S). many other uses, including options to view all files in a package, calculate disk space used, view and check md5sums, list man pages, etc.
Install dlocate in debian
#apt-get install dlocate
Usage: dlocate [option] [string...]
(no option) string list all records that match
-S string list records where files match
-L package list all files in package
-l package almost-emulation of 'dpkg -l'
-s package print package's status
-ls package 'ls -ldF' of all files in package
-du package 'du -sck' of all files in package
-conf package list conffiles in package
-lsconf package 'ls -ldF' of conffiles in package
-md5sum package list package's md5sums (if any)
-md5check package check package's md5sums (if any)
-man package list package's man pages (if any)
The -L, -s, and -S commands are roughly analagous to the equivalent dpkg commands.
Wajig is a single commandline wrapper around apt, apt-cache, dpkg, /etc/init.d scripts and more, intended to be easy to use and providing extensive documentation for all of its functions.
With a suitable sudo(1) configuration, most (if not all) package installation as well as creation tasks can be done from a user shell. Wajig is also suitable for general system administration.
A Gnome GUI command 'gjig' is also included in the package.
Install wajig in Debian
#apt-get install wajig
Common JIG commands:
update Update the list of down-loadable packages
new List packages that became available since last update
newupgrades List packages newly available for upgrading
install Install (or upgrade) one or more packages or .deb files
remove Remove one or more packages (see also purge)
toupgrade List packages with newer versions available for upgrading
upgrade Upgrade all of the installed packages or just those listed
listfiles List the files that are supplied by the named package
listnames List all known packages or those containing supplied string
whatis For each package named obtain a one line description
whichpkg Find the package that supplies the given command or file
Run LIST-COMMANDS for a complete list of commands.
package search by file and on-demand package installation tool
auto-apt checks the file access of programs running within its environments, and if a program tries to access a file known to belong in an uninstalled package, auto-apt will install that package using apt-get. This feature requires apt and sudo to work.
It also provides simple database to search which package contains a requesting file.
Install auto-apt in Debian
#apt-get install auto-apt
After installing you need to update the package list using the following command
auto-apt is a simple command line interface for setting up auto-apt ennvironment and/or search packages by filename.
run - Enter auto-apt environment run [command [cmdarg]]
update - Retrieve new lists of Contents (available file list) update
updatedb - Regenerate lists of Contents (available file list, no download) updatedb
update-local - Generate installed file lists update-local
merge - Merge lists of Contents merge
del - Delete package list del package
check - Check which package will provide the filename check [-v] [-f] filename list - List filelist in dbfile list [-v] [-f]
search - Search package by filename (grep) search [-v] [-f] pattern
debuild - debuild with auto-apt useful to get build-depends:
status - Report current environments (auto-apt or not)
For some commands, command name with -local suffix, it will use pkgfiles.db, which is created by update-local command, instead of pkgcontents.db