Home >System Tutorial >LINUX >How To Query Package Information In Debian And Ubuntu
This tutorial explores apt-cache
, a command-line utility for efficiently querying package information within Debian-based systems like Ubuntu. We'll cover its functionality and demonstrate common commands.
Table of Contents
apt-cache
?apt-cache
Commandsapt-cache
What is apt-cache
?
apt-cache
is a command-line tool that accesses your system's package cache to provide quick information about available software packages. Unlike apt-get
(used for installation and removal), apt-cache
focuses solely on retrieving package data.
Key apt-cache
Commands
Here are essential apt-cache
commands:
To find packages matching a keyword, use:
apt-cache search keyword
Example:
apt-cache search image editor
This searches for packages containing "image" and "editor" in their descriptions.
Get detailed information about a specific package with:
apt-cache show package_name
Example:
apt-cache show firefox-esr
This displays version, description, and other details for Firefox ESR.
View a package's dependencies using:
apt-cache depends package_name
Example:
apt-cache depends linux-image-amd64
This lists all packages required by linux-image-amd64
.
Check the installation policy (available versions and priorities) with:
apt-cache policy package_name
Example:
apt-cache policy python3
This shows the policy for Python 3.
List all packages in the cache using:
apt-cache pkgnames
Get cache statistics (number of packages, sizes, etc.) with:
apt-cache stats
Advantages of Using apt-cache
Summary
apt-cache
is a valuable tool for efficiently querying package information on Debian-based systems. Its speed and comprehensive information make it an essential command for any Linux user.
The above is the detailed content of How To Query Package Information In Debian And Ubuntu. For more information, please follow other related articles on the PHP Chinese website!