LinuxCommandLibrary

equery

Query Gentoo package information

TLDR

List all installed packages

$ equery list '*'
copy

Search for installed packages in the Portage tree and in overlays
$ equery list -po [package1 package2 ...]
copy

List all packages that depend on a given package
$ equery depends [package]
copy

List all packages that a given package depends on
$ equery depgraph [package]
copy

List all files installed by a package
$ equery files --tree [package]
copy

SYNOPSIS

The equery command operates primarily through subcommands. The general syntax is:

equery [global_options] subcommand [subcommand_options] [package_atom(s)]

Or, for some simple queries:

equery [global_options] subcommand [pattern]

A package_atom typically refers to a package in the format category/package-name, optionally including version, slot, or USE flags.

PARAMETERS

--explain, -e
    Provides an explanation of the command's internal logic or output, offering more verbose details on certain operations.

--no-color, --nocolor, -C
    Disables colored output, useful for scripting or terminals that don't support ANSI escape codes.

--force-color
    Forces colored output, even if standard output is not a terminal, useful for piping to `less -R`.

--quiet, -q
    Suppresses informational messages, showing only the direct results of the query.

--version, -V
    Displays the version number of the equery utility.

--help, -h
    Shows a general help message or specific help for a given subcommand when used as `equery help `.

DESCRIPTION

equery is a vital command-line utility for users of Gentoo Linux, providing a comprehensive interface to query information about packages managed by the Portage system. As a core component of Gentoo's powerful package management framework, equery allows users to delve deeply into the metadata, dependencies, installed files, and other crucial details of both installed and available software packages. It acts as an essential diagnostic and informational tool, simplifying tasks such as troubleshooting package issues, understanding complex dependency trees, identifying which packages own specific files, and assessing disk space usage. Whether you need to see what files an application installed, determine its reverse dependencies, or inspect its USE flags, equery offers quick and precise answers, empowering users with greater control and insight over their Gentoo system's software landscape.

CAVEATS

equery is intrinsically tied to the Gentoo Linux ecosystem and its Portage package manager. It cannot be used on other Linux distributions that do not utilize Portage (e.g., Debian, Ubuntu, Fedora, Arch Linux). Its functionality relies on a properly configured Portage installation and a synchronized Portage tree. While most queries are read-only and do not require elevated privileges, accessing certain system-wide or protected information might implicitly rely on the permissions of the Portage environment. Performance for complex queries or very large Portage installations can sometimes be noticeable, though typically equery is designed for efficiency.

<I>KEY SUBCOMMANDS</I>

The power of equery comes from its diverse set of subcommands, each designed for a specific query type:

  • depends <package_atom>: Shows the direct dependencies of a specified package.
  • hdepends <package_atom>: Displays the full, hierarchical dependency tree for a package.
  • rdepends <package_atom>: Lists packages that depend on the specified package (reverse dependencies).
  • files <package_atom>: Lists all files installed by a specified package.
  • list <pattern>: Lists installed packages matching a given pattern. This can also list available packages with options.
  • uses <package_atom>: Shows the USE flags enabled or available for a package.
  • size <package_atom>: Displays the disk space consumed by an installed package.
  • belongs <filepath>: Identifies which installed package a specific file belongs to.
  • check <package_atom>: Verifies the integrity of files installed by a package against the Portage database.
  • s/search <pattern>: Searches for packages in the Portage tree by name or description.

<I>PACKAGE ATOM CONCEPT</I>

In Gentoo, a 'package atom' is a precise way to refer to a package. It typically follows the format category/package-name (e.g., sys-apps/baselayout). It can also include version numbers (=net-misc/curl-8.7.1), slots (dev-lang/python:3.10), or even USE flags (net-libs/gnutls[ssl]). equery leverages package atoms to target queries accurately, allowing users to specify exactly which package instance they are interested in.

HISTORY

equery emerged as an indispensable tool within the Gentoo Linux project, evolving alongside the Portage package management system itself. As Gentoo gained popularity for its source-based approach and granular control, the need for comprehensive querying capabilities became apparent. Initially, users might have relied on a combination of lower-level Portage commands or direct inspection of the file system to gather package information. equery was developed to centralize and standardize these querying functionalities, providing a robust, user-friendly interface. Its development has been driven by the community's demand for deeper insights into package dependencies, installed files, USE flag configurations, and more. This consolidation greatly streamlined package management for Gentoo users, making complex system analysis more accessible and efficient.

SEE ALSO

emerge(1), eix(1), portage(5), ebuild(5)

Copied to clipboard