LinuxCommandLibrary

apt-cache

Search APT package information

TLDR

Search for a package in your current sources

$ apt-cache search [query]
copy

Show information about a package
$ apt-cache show [package]
copy

Show whether a package is installed and up to date
$ apt-cache policy [package]
copy

Show dependencies for a package
$ apt-cache depends [package]
copy

Show packages that depend on a particular package
$ apt-cache rdepends [package]
copy

SYNOPSIS

apt-cache [options] command [pkg...]

PARAMETERS

add
    Add a file to the source list.

depends pkg...
    Show package dependencies.

rdepends pkg...
    Show reverse dependencies.

pkgnames [prefix]
    List package names.

search regex
    Search package descriptions.

show pkg...
    Show package information.

stats
    Show interesting statistics.

dump
    Show the entire cache file.

dumpavail
    Show available version.

unmet
    Show unmet dependencies.

-h, --help
    Show help message.

-v, --version
    Show version information.

DESCRIPTION

apt-cache is a command-line tool used to query the APT (Advanced Package Tool) cache. The APT cache is a database of available packages on configured repositories. It allows users to search for packages, view package information, check dependencies, and simulate package installations/removals before actually making any changes to the system. apt-cache is a read-only tool; it does not modify the system's package configuration or install any packages.

Key features include: searching for packages by name or description, displaying detailed package information (version, dependencies, size, etc.), simulating package installations and removals to check for dependency issues, and generating lists of installed and available packages. It's a crucial utility for understanding the Debian package ecosystem and managing software on Debian-based systems like Ubuntu.

CAVEATS

The information presented by apt-cache reflects the current state of the APT cache, which may not always be perfectly synchronized with the actual state of remote repositories. It's recommended to run `apt update` periodically to refresh the cache.

USING APT-CACHE SEARCH

The `apt-cache search` command allows you to search for packages based on keywords in their name and description.
For example: `apt-cache search editor` will show all packages with "editor" in name or description.

HISTORY

apt-cache is part of the APT package management system, initially developed for Debian. It evolved as a powerful tool to interact with and understand the complex dependencies and availability of packages within the Debian ecosystem. Over time, it has become a standard utility for package management on Debian-based systems and has seen continued development and improvements to its functionality and performance.

SEE ALSO

Copied to clipboard