commands
apt-cache — inspect cached package metadata
Reads cached package metadata and shows installed and candidate versions and priorities. Does not refresh repositories; cached information may be stale. Use the specified distribution and fresh private workspace; no sudo.
Formal Syntax & Structure
linux syntaxlinux
apt-cache policy [PACKAGE]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| PACKAGE | operand | package name |
Return Value
exit status and output
Reads cached package metadata and shows installed and candidate versions and priorities. Does not refresh repositories; cached information may be stale.
Working Example
Example Snippetlinux
apt-cache policy bash | grep 'Candidate:' >/dev/null && printf 'candidate field found\n'