Equery/ja

equery は、Portage におけるいくつかの一般的な操作をより簡単にするためのツールです. パッケージの依存関係、メタデータ、インストールされたファイルなどを表示可能です.

emerge
単純に、以下のようにします.

equery は、 パッケージでインストールされるツールセットの一部です. equery や他のツールのインストールについて、詳しくは Gentoolkit の記事を読んでください.

はじめに
equeryはシステムにインストールされたパッケージについて役に立つ情報を出力するためのツールです. equeryはモジュール群に基づいています. 個々のモジュールは略称であらわされます. 例えば、equery l gccはequery list gccと同じです. オプションを付けて起動(equery --help)すると、グローバルなオプション、すべての使用可能なモジュール、そしてそれらの略称が表示されます. Adding a module name to the end (equery --help module) will display the help screen for that specific module. Lastly, executing man equery will also provide a detailed explanation of all available modules and options along with some useful examples.

下に示すのは、多くのモジュールで使うことのできる機能の一覧です.

emerge</tt>と同様、equery</tt>は部分的なパッケージ名を理解しません:

emerge</tt>とは違い、equery</tt>はカテゴリ名およびパッケージ名に関してシェルライクなワイルドカードを受け付けます:

ほとんどのequeryモジュールは複数の入力を受け付けます:

いくつかのモジュールは完全な正規表現も扱うことができます:

The next few sections in this document give a quick introduction to the different equery</tt> modules.

機能
To see a list of all equery's capabilities, simply run it without arguments:

エイリアス
A common approach to working with equery</tt> is to create aliases. When using bash these can usually be placed in the file:

belongs (b): 特定のファイルについて、提供したパッケージを検索
can search for files matching a regular expression with the  option. The  option stops searching after it finds a match. Since no file on your system should be owned by two packages, this is a safe optimization.

A short version of   can also be used. For example, to list what package equery</tt> belongs to:

changes (c): 特定のパッケージの ChangeLog を表示
lets the user view ChangeLog entries for a package version or range of versions. Imagine after running an emerge --sync</tt> Portage prints out a message saying it is going to be upgraded. To see what has changed this command can be used:

check (k): 特定のパッケージの状態が完全か検査
equery</tt> は、パッケージのインストール状態が完全か調べたいときに便利です. MD5 チェックサムやタイムスタンプを照合し、壊れていたり書き換えられていたり削除されていたりしている可能性がないか検出することが可能です.

depends (d): 特定のパッケージが必要な全てのパッケージをリスト表示
Ever wonder why a certain package has been installed on the system? equery</tt> can tell which packages list it as a dependency with. Include indirect dependencies with the  option.

A second example lists all packages directly depending on udev:

depgraph (g): 特定のパッケージに必要なパッケージを表示
の逆です. 指定したパッケージ**に**必要な全てのパッケージを表示します（「指定したパッケージ**が**必要なパッケージ」ではありません）. 直接に必要なパッケージのみならず、再帰的に、間接的に必要なパッケージも表示します. 何階層にわたり再帰検索を行うかについては、  オプションを用いて指定します.

USE フラグが有効なときには、 が直接に必要で、   が間接的に必要になることがわかります.

files (f): 特定のパッケージが含むファイルのリストを表示
equery</tt> can list all the files installed by an ebuild with the  module. Try  to get an easy to read directory layout. Use  to only find a certain type of file. For example, to find where executables were installed use, or to quickly find the configuration file location try.

Another example, to list all files installed by ncmpcpp:

Descriptions of other modules and additional command line flags can be found in the equery man page ( man equery ).

hasuse (h): 特定の USE フラグをもつパッケージを検索
can be used to find packages with a given USE flag. will not indicate if the flag is enabled, only if the ebuild lists it as an option. See the EXAMPLES section of  in the equery</tt> man page for more tip on getting this kind of information.

list (l): パッケージをリスト表示
is a simple, yet powerful module to list packages that are installed, in the Portage tree or in an overlay.

The standard query will search installed packages for the given package name. Passing in  displays all packages in the set. In the leftmost field it is possible to see all the above packages are (nstalled) and from the  (ortage) tree. They are not masked (the second field is blank), and they are all installed in the default slot (0).

Use local options to look for packages in the Portage tree and overlays.

In this is it possible to see version 7.2.182 is installed and there are no versions available from an overlay. Users can see which versions are keyword masked by the  in the second field.

meta (m): パッケージのメタデータを表示
Each package in the Portage tree provides at least some metadata about its maintainer, herd, etc. The amount of useful information depends on how much package maintainers decide to provide. With no options,  returns some basic useful information.

Some maintainers provide extra information about the package which be very useful:

Finding package sizes with size (s)
Ever been curious to find out how much space a specific package is occupying? Since a package could have its files over a number of directories, the usual du -hc</tt> command might not give the correct figure. Not to worry, equery</tt> to the rescue!

Using  prints the total space used in human-readable units and lists the total number of files the package has. To get the total size in bytes use.

Listing per-package USE flags with uses (u)
equery</tt>'s  module can provide information about what USE flags are available for a specific package and which of those flags is currently enabled.

Here a number of USE flags are enabled in gstreamer's plugin meta-package, but it can be seen that there are other USE flags available. For more information on USE flags, please refer to the USE Flags chapter of the Gentoo Handbook.

Finding the ebuild path with which (w)
is a simple script to help users quickly find the file path to an ebuild. If an unversioned package name is passed using  it will return the path to the newest installable ebuild version. In other words, it would return the ebuild Portage would use if emerge example/package</tt> was typed. also accepts a versioned package to get the path to that ebuild.

Lastly, if none of the above features of <tt>equery</tt> have provided an answer, try using  to manually search an ebuild with programs like <tt>cat</tt>, <tt>less</tt> or <tt>grep</tt>: