apt-cache(8)
Query the APT package cache for package information and dependencies.
Synopsis
apt-cache [OPTION]... COMMAND [PKG]...Description
apt-cache performs a variety of operations on the APT package cache. It is used to query information about packages, search for packages by name or description, and examine package dependencies and relationships without modifying the system.
Common operations include searching for packages, displaying package details, checking dependencies, and generating statistics about the cache. apt-cache reads from the local cache and does not require root privileges.
Common options
| Flag | What it does |
|---|---|
-p, --package-list FILE | read package list from FILE instead of the cache |
-s, --src-cache FILE | use FILE as the source cache |
-q, --quiet | suppress normal output (useful in scripts) |
-i, --important | print only important dependencies in depends output |
-a, --all-versions | show all versions of packages |
--no-all-versions | show only the candidate version (default) |
-g, --generate | perform automatic cache regeneration |
--no-generate | disable automatic cache regeneration |
-h, --help | display help message |
Examples
search for packages matching 'nginx' in cache
apt-cache search nginxdisplay detailed information about the curl package
apt-cache show curlshow dependencies of the vim package
apt-cache depends vimshow reverse dependencies (packages that depend on libssl1.1)
apt-cache rdepends libssl1.1display version policy and available versions for python3
apt-cache policy python3search for exact package name 'gcc' using full-names flag
apt-cache search --full-names '^gcc$'list all package names containing 'lib'
apt-cache pkgnames | grep libdisplay cache statistics including total packages and size
apt-cache stats