apt-cache
Query the APT package cache
TLDR
SYNOPSIS
apt-cache [options] command [arguments]
DESCRIPTION
apt-cache queries the local APT package cache to search for packages, display detailed package information, and analyze dependency relationships. It reads the package index files downloaded by apt update and provides fast, offline access to package metadata without contacting remote repositories.Common operations include searching for packages by name or description, inspecting version and dependency details, checking installation policies, and listing reverse dependencies. The output is suitable for scripting and can help diagnose dependency conflicts or determine which repository provides a given package.
PARAMETERS
search regex
Search for packages matching the POSIX regex in names and descriptionsshow package
Show detailed package record for a packageshowpkg package
Show general information including versions and dependenciesshowsrc package
Show all source package records for a packagepolicy [package]
Show policy settings, installation status, and repository prioritiesdepends package
Show dependencies for a packagerdepends package
Show reverse dependencies (packages that depend on this one)madison package
Show available versions in a tabular formatpkgnames [prefix]
List all package names in the cache, optionally filtered by prefixstats
Show cache statisticsdump
Show a short listing of every package in the cacheunmet
Show a summary of all unmet dependencies in the cache-f, --full
Print full package records when searching-n, --names-only
Only search package names, not descriptions-i, --important
Print only Depends and Pre-Depends relations (for use with depends and unmet)--installed
Limit output to currently installed packages--recurse
Make depends and rdepends recursive
CONFIGURATION
/etc/apt/sources.list
Main file listing configured package repositories./etc/apt/sources.list.d/
Directory for additional repository source files./etc/apt/preferences.d/
Directory for package pinning and priority preferences.
CAVEATS
This tool operates on the local cache; run apt update first to ensure the cache is current.
HISTORY
Part of the APT (Advanced Package Tool) suite developed for Debian-based systems in the late 1990s.
