apt-cache
(8)query the APT cache
Options
20-p--pkg-cacheSelect the file to store the package cache. The package cache is the primary cache used by all operations. Configuration Item: Dir::Cache::pkgcache.
-s--src-cacheSelect the file to store the source cache. The source is used only by gencaches and it stores a parsed version of the package information from remote sources. When building the package cache the source cache is used to avoid reparsing all of the package files. Configuration Item: Dir::Cache::srcpkgcache.
-q--quietQuiet; produces output suitable for logging, omitting progress indicators. More q's will produce more quietness up to a maximum of 2. You can also use -q=# to set the quietness level, overriding the configuration file. Configuration Item: quiet.
-i--importantPrint only important dependencies; for use with unmet and depends. Causes only Depends and Pre-Depends relations to be printed. Configuration Item: APT::Cache::Important.
--no-pre-depends--no-depends--no-recommends--no-suggests--no-conflicts--no-breaks--no-replaces--no-enhancesPer default the depends and rdepends print all dependencies. This can be tweaked with these flags which will omit the specified dependency type. Configuration Item: APT::Cache::ShowDependencyType e.g. APT::Cache::ShowRecommends.
--implicitPer default depends and rdepends print only dependencies explicitly expressed in the metadata. With this flag it will also show dependencies implicitly added based on the encountered data. A Conflicts: foo e.g. expresses implicitly that this package also conflicts with the package foo from any other architecture. Configuration Item: APT::Cache::ShowImplicit.
-f--fullPrint full package records when searching. Configuration Item: APT::Cache::ShowFull.
-a--all-versionsPrint full records for all available versions. This is the default; to turn it off, use --no-all-versions. If --no-all-versions is specified, only the candidate version will be displayed (the one which would be selected for installation). This option is only applicable to the show command. Configuration Item: APT::Cache::AllVersions.
-g--generatePerform automatic package cache regeneration, rather than use the cache as it is. This is the default; to turn it off, use --no-generate. Configuration Item: APT::Cache::Generate.
-n--names-onlyOnly search on the package and provided package names, not the long descriptions. Configuration Item: APT::Cache::NamesOnly.
--all-namesMake pkgnames print all names, including virtual packages and missing dependencies. Configuration Item: APT::Cache::AllNames.
--recurseMake depends and rdepends recursive so that all packages mentioned are printed once. Configuration Item: APT::Cache::RecurseDepends.
--installedLimit the output of depends and rdepends to packages which are currently installed. Configuration Item: APT::Cache::Installed.
--with-sourcefilenameAdds the given file as a source for metadata. Can be repeated to add multiple files. Supported are currently *.deb, *.dsc, *.changes, Sources and Packages files as well as source package directories. Files are matched based on their name only, not their content! Sources and Packages can be compressed in any format apt supports as long as they have the correct extension. If you need to store multiple of these files in one directory you can prefix a name of your choice with the last character being an underscore ("_"). Example: my.example_Packages.xz Note that these sources are treated as truste
-h--helpShow a short usage summary.
-v--versionShow the program version.
--auditShow audit (and notice) messages. This overrides the quiet option, but only for notice messages, not progress ones.
-c--config-fileConfiguration File; Specify a configuration file to use. The program will read the default configuration file and then this configuration file. If configuration settings need to be set before the default configuration files are parsed specify a file with the APT_CONFIG environment variable. See apt.conf(5) for syntax information.
-o--optionSet a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be used multiple times to set different options.
--no-color--colorTurn colors on or off. Colors are on by default on supported terminals for apt(8) and can also be disabled using the NO_COLOR or APT_NO_COLOR environment variables, or further configured by the APT::Color configuration option and scope, see apt.conf(5) for information on that.
DESCRIPTION
apt-cache performs a variety of operations on APT's package cache. apt-cache does not manipulate the state of the system but does provide operations to search and generate interesting output from the package metadata. The metadata is acquired and updated via the 'update' command of e.g. apt-get, so that it can be outdated if the last update is too long ago, but in exchange apt-cache works independently of the availability of the configured sources (e.g. offline).
Unless the -h, or --help option is given, one of the commands below must be present.
gencaches
showpkg pkg...
Package: libreadline2 Versions: 2.1-12(/var/state/apt/lists/foo_Packages), Reverse Depends:
libreadlineg2,libreadline2
libreadline2-altdev,libreadline2 Dependencies: 2.1-12 - libc5 (2 5.4.0-0) ncurses3.0 (0 (null)) Provides: 2.1-12 - Reverse Provides:
stats
showsrc pkg...
dump
dumpavail
unmet
show pkg...
search regex...
Separate arguments can be used to specify multiple search patterns that are and'ed together.
depends pkg...
rdepends pkg...
pkgnames [prefix]
Note that a package which APT knows of is not necessarily available to download, installable or installed, e.g. virtual packages are also listed in the generated list.
dotty pkg...
The resulting nodes will have several shapes; normal packages are boxes, pure virtual packages are triangles, mixed virtual packages are diamonds, missing packages are hexagons. Orange boxes mean recursion was stopped (leaf packages), blue lines are pre-depends, green lines are conflicts.
Caution, dotty cannot graph larger sets of packages.
xvcg pkg...
policy [pkg...]
madison pkg...
FILES
/etc/apt/sources.list
/etc/apt/sources.list.d/
/var/lib/apt/lists/
/var/lib/apt/lists/partial/