pacman-q
Query installed packages
TLDR
View documentation for the original command
SYNOPSIS
pacman -Q [options] [package_name(s)]
PARAMETERS
-a
Query all packages in the sync database. Note: requires a database to be specified with -y.
-c
Show each package's change reason.
-d <dir>
Specify an alternate database location. Used when querying a different root or for offline querying.
-e
List explicitly installed packages.
-g <group>
List members of package group.
-i
Show information for given package(s). If no package is given, show information for every installed package. Output includes the package description, installation date, and installed size.
-k
Perform database integrity checks.
-l <package>
List files owned by package.
-m
Show list of packages that are considered foreign.
-n
Query packages that are not found in sync database.
-o <file>
Query the package that owns file.
-p <package_file>
View package information from package file. This does not require the package to be installed.
-q
Quiet output. Only prints the package name.
-s <search_string>
Query packages containing search_string in name or description.
-t <target>
Specify a target package. Used in conjunction with other options.
-u
Query packages that have newer versions in sync databases.
-w <dir>
Specify an alternate root directory.
-y
Refresh the package databases from the server. This is useful before using -s
or -u
to ensure you have the latest information.
-x <regex>
Use regex to query package names.
--changelog <package>
Shows package changelog.
--dbpath <path>
Sets an alternative database location.
--files
Shows a list of installed files, similar to -l
, but without specifying a package name.
--groups
Shows a list of all package groups.
DESCRIPTION
The pacman-q
command is a powerful utility for querying the pacman database, which stores information about installed packages on an Arch Linux system (or distributions based on Arch). It allows users to retrieve detailed information about installed packages, such as their version, dependencies, installation date, and description. This command is essential for system administrators and advanced users for package management and troubleshooting.
The basic usage involves specifying options to filter and display the desired information. Common options include querying by package name, listing all installed packages, showing dependencies, and more. The output can be customized using various flags. pacman-q
provides insight into the state of your system's software, which aids in identifying conflicts, managing dependencies, and understanding the package landscape.
CAVEATS
The information returned by pacman-q
is only as accurate as the pacman database. If the database is corrupted or out of sync, the results may be misleading. Ensure the database is synchronized with pacman -Sy
before querying.
RETURN CODES
pacman-q
returns 0 on success and a non-zero value on failure. Common failures include invalid options or not finding the requested package.
SEE ALSO
pacman(8), pacman-S(8), pacman-R(8)