EQUERY(1)

NAME
equery - Gentoo Package Query Tool

SYNOPSIS
equery [global-options] module [local-options]

DESCRIPTION
Equery is a collection of modules for querying the state of Gentoo packages, files and USE flags.

GLOBAL OPTIONS

-h, --help
Output a help message.

-q, --quiet
Be less verbose where possible. In some modules, this option can increase the output speed.

-C, --no-color
Do not colorize output.

-N, --no-pipe
Turn off automatic pipe detection. Use this option if you do not want equery to detect if the output is being directed to the screen or to another program and adjust color and verbosity accordingly.

-V, --version
Display Gentoolkit's version. Please include this in all bug reports. (see BUGS below)

MODULES
Equery uses a system of modules. Each module has both a long and short name. The list below uses the notation "module (m)", where m is the short name and module is the long name.

You can view the help message for a specific module by using -h, --help as either a global option (after equery and before the module name) or as a local option (after the module name).

  belongs (b) [OPTIONS] FILE
List the package that owns FILE.

Note: Normally, only one package will own FILE. If multiple packages own the same file it should be reported. (see BUGS below) LOCAL OPTIONS:

-f, --full-regex
The supplied query is a regular expression.

-e, --early-out
Stop when the first match is found. This is generally a safe optimization when searching for the owner of a single file.

-n, --name-only
Do not print the version.

EXAMPLES:

equery belongs --early-out /usr/bin/euse
Find out what package installed a certain command.

emerge -p $(equery -q belongs -nf '^/usr/bin/g?vim.*')
Tell emerge to reinstall or update any package that installed a file matching a regular expression.

  check (k) [OPTIONS] PKG
Check timestamps and MD5 sums for files owned by PKG, where PKG is an installed package. LOCAL OPTIONS:

-f, --full-regex
The supplied query is a regular expression.

-o, --only-failures
Only display packages which don't pass all checks.

EXAMPLES:

equery check --only-failures '*'
Verify timestamps and MD5 sums for all installed packages and show only packages which fail checks.

equery check 'dev-python/*' dev-lang/python
Verify every installed package in the dev-python category, and Python itself.

  depends (d) [OPTIONS] PKG
List all packages that depend on PKG. LOCAL OPTIONS:

-a, --all-packages
Include dependencies that are not installed. This can take a while.

-D, --indirect
Search for both direct and indirect dependencies.

-F, --format=TMPL
Customize the output format of the matched packages using the template string TMPL. See the --format option for list below for a description of the TMPL argument.

--depth=NUM
Limit the indirect dependency tree to a depth of NUM. --depth=0 is equivalent to not using --indirect.

EXAMPLES:

equery depends --indirect xulrunner
Figure out why a package got installed on your system.

  depgraph (g) [OPTIONS] PKG
Display a direct dependency graph for every matching version of PKG. A dependency graph is an indented tree showing the relationship between packages and their dependencies. LOCAL OPTIONS:

-A, --no-atom
Do not show the dependency atom that match the package.

-U, --no-useflags
Do not show USE flags.

-l, --linear
Do not format the graph by indenting dependencies. This option will print the recursion depth in square brackets before the package name for easier viewing in narrow terminals.

--depth=NUM
Limit the dependency graph to a depth of NUM. --depth=0 means no maximum depth. Default depth is set to 1.

EXAMPLES:

equery depgraph --depth=0 portage
View a full tree of all direct and indirect compile-time, run-time, and post-merge dependencies for a package.

  files (f) [OPTIONS] PKG
List files and directories installed by PKG. LOCAL OPTIONS:

-m, --md5sum
Include the file's MD5 sum in the output.

-s, --timestamp
Include the file's timestamp in the output.

-t, --type
Include the file type in the output.

--tree
Display files in a tree format. This option turns off all other local options.

-f, --filter=RULES
Filter output by file type.

RULES
A comma-separated list (no spaces); choose from:
dir, obj, sym, dev, path, conf, cmd, doc, man, info

EXAMPLES:

equery files --tree vlc
View a file tree of all files installed by a package.

equery files --filter=cmd vlc
Find out where a package installed its executables.

  has (a) [OPTIONS] KEY VALUE
List all installed packages that have a given KEY match. Note: KEY is case sensitive. Also has does not currently have the ability to intelligently compare values depending on the type of information being looked up. It performs a simple string match. It can only list which packages have the matching VALUE as given on the command line. It is a general purpose lookup for most information available via portage's dbapi.aux_get() function. Warning: the quality of the results printed is dependant on the quality of the search (given the limited comparison method) and the recorded data available in the vardb. (See EXAMPLES) LOCAL OPTIONS:

-I, --exclude-installed
Exclude installed packages from being output.

-o, --overlay-tree
Include package from overlays in the search path.

-p, --portage-tree
Include all packages from the Portage tree in the search path. Use this option to search through all standard Gentoo packages, including those that are not installed.

-F, --format=TMPL
Customize the output format of the matched packages using the template string TMPL. See the --format option for list below for a description of the TMPL argument.

OUTPUT:

(See OUTPUT for list below)

EXAMPLES:

equery has SLOT 2.4
View all installed Gentoo packages that have a recorded SLOT = "2.4".

equery has repository sunrise
View all installed Gentoo packages that were recorded to be installed from ebuilds from the "sunrise" overlay.

equery has EAPI 2
View all installed Gentoo packages that were installed with ebuilds with a recorded EAPI of "2".

  hasuse (h) [OPTIONS] USE
List all installed packages that have a given USE flag. Note: hasuse does not currently have the ability to display if packages are built with the given USE flag or not. It can only list which packages have the flag as an option. (See EXAMPLES) LOCAL OPTIONS:

-I, --exclude-installed
Exclude installed packages from being output.

-o, --overlay-tree
Include package from overlays in the search path.

-p, --portage-tree
Include all packages from the Portage tree in the search path. Use this option to search through all standard Gentoo packages, including those that are not installed.

-F, --format=TMPL
Customize the output format of the matched packages using the template string TMPL. See the --format option for list below for a description of the TMPL argument.

OUTPUT:

(See OUTPUT for list below)

EXAMPLES:

equery hasuse -pI perl
View all Gentoo packages that have the "perl" USE flag, excluding installed packages.

USE="perl"; for PKG in $(equery -q hasuse $USE); do echo $PKG: $(equery -q uses $PKG |grep $USE); done
This Bash one-liner uses hasuse to find a list of packages that have a certain USE flag, and uses to check whether the flag is enabled or disabled. Modify USE="perl" to change the query.

  keywords (y) [OPTIONS] PKG
Display keywords for specified PKG or for PKG that is in pwd. LOCAL OPTIONS:

-h, --help
Show this help message and exit.

-v, --version
Show package version and exit.

-a, --arch ARCH
Display only specified arch(s). (default: []).

-A, --align [{top,bottom}]
Specify alignment for descriptions. (default: bottom)

-T, --top-position [{archlist,versionlist}]
Specify which fields we want to have in top listing. (default: archlist)

-B, --bold
Print out each other column in bold for easier visual separation. (default: False)

-C, --color
Force colored output. (default: False)

-O, --overlays
Search also overlays. (default: False)

-P, --prefix
Display prefix keywords in output. (default: False)

-S, --ignore-slot
Treat slots as irrelevant during detection of redundant packages. (default: False)

OUTPUT:
    Keywords for sys-apps/coreutils:
              |                               |   u   |
              | a   a     p s     l r   a     |   n   |
              | m   r h   p p   i o i s l m m | e u s | r
              | d a m p p c a x a o s 3 p 6 i | a s l | e
              | 6 r 6 p p 6 r 8 6 n c 9 h 8 p | p e o | p
              | 4 m 4 a c 4 c 6 4 g v 0 a k s | i d t | o
    ----------+-------------------------------+-------+-------
      8.32-r1 | + + + + + + + + ~ o ~ ~ ~ ~ ~ | 7 # 0 | gentoo
       9.1-r2 | + + + + + + + + ~ ~ ~ ~ ~ ~ ~ | 7 o   | gentoo
       9.2-r2 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | 8 #   | gentoo
       9.3    | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | 8 #   | gentoo
       9.3-r1 | + ~ ~ + + ~ + ~ ~ ~ ~ ~ ~ ~ ~ | 8 #   | gentoo
    [I]9.3-r2 | + ~ ~ + + ~ + ~ ~ ~ ~ ~ ~ ~ ~ | 8 o   | gentoo
      9999    | o o o o o o o o o o o o o o o | 8 o   | gentoo

EXAMPLES:

equery keywords coreutils
Show the keywording status of the sys-apps/coreutils package on Gentoo-supported architectures.

  list (l) [OPTIONS] PKG
List installed versions of PKG or all packages matching the query pattern. LOCAL OPTIONS:

-d, --duplicates
List only packages with more than one version installed.

-f, --full-regex
The supplied query is a regular expression.

-m, --mask-reason
Print the reason why a package was masked.

-I, --exclude-installed
Exclude installed packages from being output.

-o, --overlay-tree
Include package from overlays in the search path.

-p, --portage-tree
Include all packages from the Portage tree in the search path. Use this option to search through all standard Gentoo packages, including those that are not installed.

-F, --format=TMPL
Customize the output format of the matched packages using the template string TMPL. TMPL can contain the following placeholders:

    $cp - Contains the category and the package name only (e.g 'app-portage/gentoolkit').

    $cpv - Contains the category, the package name and the full version (e.g. 'app-portage/gentoolkit-0.3.0_rc10-r1').

    $category - Contains just the category (e.g. 'app-portage').

    $name - Contains just the package name (e.g. 'gentoolkit').

    $version - Contains the package version (without the revision) (e.g. '0.3.0_rc10').

    $revision - Contains the package revision (e.g. 'r1').

    $fullversion - Contains the package version including its revision (e.g. '0.3.0_rc10-r1').

    $slot - Contains the package's slot.

    $repo - Contains the name of the package's repository (e.g. 'gentoo').

    $mask - The Mask-status field (~M-??), see OUTPUT below for an explanation.

    $mask2 - Contains a verbose description of the packages masking status.

    $location - The Location field (IPO-), see OUTPUT below for an explanation.

    Apart from the above placeholders the template string can contain arbitrary text as desired. Similar to bash variables, curly braces can be used to disambiguate the variable names from the enclosing text.

OUTPUT:
    $ equery list binutils
     * Searching for binutils ...
     [I--] [??] sys-devel/binutils-2.18-r1:i686-pc-linux-gnu-2.18
     [IP-] [ ~] sys-devel/binutils-2.19.1-r1:i686-pc-linux-gnu-2.19.1

Location field ([IPO-]):
The first field shows the location and install status of the package. It consists of three letters in square brackets. I indicates the package is currently installed. P indicates the package is available in the Portage tree. O indicates the package is available in at least one overlay. - is a place holder and has no meaning. [I-O] would mean that the package is installed and available from an overlay, but not available from the Portage tree.

Mask-status field ([ ~M-??]):
The second field shows the mask status of the package. Empty brackets indicate that the package is unmasked. A ~ means the package is masked by keyword, e.g., you are running a stable system and the package is marked testing). M means hard masked, e.g., the package maintainer has determined the package is unfit for widespread usage. - means arch masked, e.g., you are running an amd64 system, but this package only works on x86. Lastly, ?? only occurs when the location field is [I--]. Together, they indicate that the package was installed from the Portage tree or an overlay, but has since been removed from that tree; therefore equery can not determine a mask status for it.

Package name:
The third field is the full package name and version.

Slot:
The fourth field, after the colon, is the package's slot. 0 is the default slot. To find all packages with multiple slots installed, use --duplicates.

Note: Because it takes extra processing time to determine the location, mask status and slot, you can speed up output by passing the --quiet global option to equery when you don't care about the extra information. Note: Additionally, when using --quiet, if no matches are found, instead of printing an error, the equery list module will return with an exit value of 3.

EXAMPLES:

equery list '*'
List all installed packages. This is equivalent to 'equery list' in Gentoolkit versions prior to 0.3.0.

equery list -op mozilla-firefox
List all available versions of the package exactly matching 'mozilla-firefox'. This is equivalent to 'equery list --exact-name -o -p mozilla-firefox' in Gentoolkit versions prior to 0.3.0.

equery list '*zilla*'
List all packages that contain (fuzzy match) 'zilla'. This is equivalent to 'equery list zilla' in Gentoolkit versions prior to 0.3.0.

equery list 'www-client/*'
List all packages in the category www-client. This is equivalent to 'equery list --category=www-client' in Gentoolkit versions prior to 0.3.0.

equery list --duplicates '*'
List all packages with more than one version installed. This is equivalent to 'equery list --duplicates' in Gentoolkit versions prior to 0.3.0.

equery list -F '$cp:$slot' '*'
Get a list of slotted atoms for all installed packages.

equery list -po -F '[$location] [$mask] $cpv:$slot [$repo]' '*'
Show all packages in the default (verbose) output format but also include their repository name.

  meta (m) [OPTIONS] PKG
Display metadata about PKG. meta reads a file called metadata.xml which must be included with all Portage tree packages. meta does not read ebuilds, so it can only return version independent metadata. Since until now there had not been an easy way for users to view metadata.xml, and because package maintainers are only required to fill out a very small portion of the file, there are still many packages without detailed metadata available. For more information about metadata.xml, see:
    https://devmanual.gentoo.org/ebuild-writing/misc-files/metadata/index.html
LOCAL OPTIONS:

-d, --description
Show an extended package description.

-k, --keywords
Show keywords for all matching versions. keywords does not list all keywords for all versions. Instead, it filters the list to make it easier to spot versions that need bumping or are okay to remove from the tree. It filters by slot. For example:
Keywords: 1.35.0-r3:0:
Keywords: 1.35.0-r5:0: amd64 hppa ppc x86 ~alpha ~arm ~ia64 ~mips ~ppc64 ~s390 ~sh ~sparc
In this output from equery meta boost, -r5 is the highest available version in slot 0, so all keywords are listed. The actual keywords for -r3 are "~amd64 ~hppa ~ppc ~x86", but since a higher version in the same slot has the same or more stable keywording, they are filtered out. Arch mask keywords (-*) are always shown.

-m, --maintainer
Show the package maintainer(s) email address. If the metadata is available, also show the maitainer's name and/or job description. (shown by default)

-u, --useflags
Show per-package USE flag descriptions. Per-package USE flag descriptions are sometimes added to metadata.xml if the affect of the USE flag is unusual, or if the USE flag is rare enough to be undefined in the global definition file. equery uses now displays these same local descriptions as well, so this option is left in meta for completeness only.

-U, --upstream
Show information about the package's upstream project, including the author's email, upstream bug tracker or upstream documentation. At the time of writing, most maintainers do not provide this information. (shown by default)

-x, --xml
Dump the plain XML file to the screen.

EXAMPLES:

equery meta gnucash
Show general information about maintainership, including maintainer and upstream.

equery meta --description app-misc/screen
See if the package maintainer has provided an extended description.

equery -N meta -H gnome-base/gnome |grep -o --color=never '[^( ]*@gentoo.org'
Extract the maintainers's email address to let them know they're doing a great job. Remember, bug reports should go to bugs.gentoo.org. The above example will extract one or more emails if available.

  size (s) [OPTIONS] PKG
Print total size of files contained in a given PKG. LOCAL OPTIONS:

-b, --bytes
Report package size in bytes.

-f, --full-regex
The query is a regular expression.

EXAMPLES:

equery -q size 'www-client/*'
Get a one-line summary of the number of files and total size (in bytes) of those files for each installed package in a category.

  uses (u) [OPTIONS] PKG
Display USE flag statuses and descriptions for a given PKG. LOCAL OPTIONS:

-a, --all
Display all package versions. Without this option, equery will choose the best available version.

-f, --forced-masked
Show the forced and masked USE flags

-i, --ignore-l10n
Do not show the l10n USE flags

EXAMPLES:

equery uses app-misc/beagle
See which USE flags are enabled for a specific package.

USE="perl"; for PKG in $(equery -q hasuse $USE); do echo $PKG: $(equery -q uses $PKG |grep $USE); done
This Bash one-liner uses hasuse to find a list of packages that have a certain USE flag, and uses to check whether the flag is enabled or disabled. Modify USE="perl" to change the query.

  which (w) [OPTIONS] PKG
Display the path to the ebuild that would be used by Portage with the current configuration. LOCAL OPTIONS:

-m, --include-masked
Return the path to the highest version ebuild available.

-e, --ebuild
Print the contents of the ebuild

EXAMPLES:

equery which -e xorg-server
View the most recent installable ebuild.

BUGS
Submit bug reports to https://bugs.gentoo.org.

AUTHORS
Karl Trygve Kalleberg <karltk@gentoo.org>, 2003
Katerina Barone-Adesi <katerinab@gmail.com>, 2004
Douglas Anderson <douglasjanderson@gmail.com>, 2009