equery
Query Gentoo package information
TLDR
List all installed packages
Search for installed packages in the Portage tree and in overlays
List all packages that depend on a given package
List all packages that a given package depends on
List all files installed by a package
SYNOPSIS
equery [global-options] <subcommand> [subcommand-options arguments]
PARAMETERS
-C, --nocolor
Disable color output
-h, --help
Display help message
-q, --quiet
Suppress non-error output
-V, --version
Show equery version
belongs [files...]
List packages owning specified files
depgraph [options] <atom>
Display dependency graph for package atom
files [options] <atom>
List files installed by package atom
hasuse [options] <atom useflag>
Check if package supports given USE flag
list [-C pattern]
List installed packages matching pattern
meta [options] <atom>
Show package metadata (description, homepage, etc.)
size [options atoms...]
Calculate disk size of installed packages
uses [-a options] <atom>
Show enabled/disabled USE flags for package
which [options] <atom>
Locate ebuild file for package atom
DESCRIPTION
equery is a powerful command-line tool from Gentoo's gentoolkit package, designed to query the Portage package database for detailed information about installed packages and ebuilds.
It provides subcommands to inspect file ownership, dependencies, USE flags, disk usage, metadata, and more, making it essential for Gentoo users managing complex package states.
Unlike emerge, which handles installation, equery focuses solely on read-only queries, enabling quick checks without modifying the system. It's faster than parsing /var/db/pkg manually and offers formatted output with color support.
Common uses include verifying which package owns a file (belongs), listing files in a package (files), or examining USE flags (uses). It's widely used in troubleshooting, auditing, and scripting on Gentoo-based systems.
CAVEATS
Gentoo-specific; requires app-portage/gentoolkit installed. Does not query uninstalled ebuilds (use eix for overlays). Output assumes standard Portage layout.
COMMON EXAMPLE
equery belongs /usr/bin/ls
Shows package owning /usr/bin/ls.
equery uses sys-apps/coreutils
Lists USE flags for coreutils.
ATOM FORMAT
Use Portage atoms like sys-apps/coreutils or =sys-apps/coreutils-9.4 for precise queries.
HISTORY
Developed in early 2000s as part of Gentoo's gentoolkit by maintainers like Robin H. Johnson. Evolved with Portage; current versions support modern features like sets and binary packages.


