Original website: Ubuntu command series -- usage of apt-cache command_IT sharp knife unsheathed blog-CSDN blog
Introduction
This article introduces the usage of the apt-cache command in Linux.
apt-cache showpkg pkg_name
Display some general information about the package, such as: name, version, forward and reverse dependencies, etc.
例:apt-cache showpkg openssh
apt-cache stats pkg_name
show relevant statistics
apt-cache dump pkg_name
Displays a brief description of each package in the cache.
apt-cache unmet pkg_name
Show non-conforming dependencies
apt-cache show pkg_name
Display logging information for the specified package. Similar to rpm -qi
apt-cache search pkg_name
without parameters
Find packages that support regular expressions.
Example 1: Find all packages with openssh (including package name and description)
apt-cache search openssh
Example 2: Find packages matching .*jdk.* (including package name and description)
apt-cache search .*jdk.*
--names-only
Find search terms only in package names.
Example 1: Find all software packages with openssh in their names (excluding descriptions, etc.)
apt-cache search openssh
--full
show details
Example 1: Find all packages with openssh (including package name and description), and list detailed information.
apt-cache search openssh --full
apt-cache depends pkg_name
Show dependencies of a package.
apt-cache policy pkg_name
If a package name is specified, it will show whether the package is already installed, in which version of the repository it is available, and its priority.
By default, each installed package version has priority 100, and non-installed packages have priority 500.
There may be multiple versions of the same package with different priorities. APT will install the version with higher priority unless the installed version is newer.
apt-cache pkgnames pkg_name
List all packages.