Equery/zh-cn

是一个用于简化常用 Portage 操作的工具. 此外，它可以显示包依赖项、元数据和已安装文件.

Emerge
Equery是使用包安装的工具集的一部分：

有关安装或其他工具的更多信息，请访问Gentoolkit文章.

介绍
是一个显示系统上已安装软件包有用信息的工具，基于模块系统. 每个模块都有一个简写名称. 例如，运行与运行相同. 调用 选项（）将输出全局选项并列出所有可用模块及其简写名称. 将模块名称添加到末尾（）将显示该特定模块的帮助信息. 执行还将提供所有可用模块和选项的详细说明以及一些有用的示例.

以下是适用于大多数模块的功能列表.

和一样，不理解部分的包名称：

与不同，可以在类别或包名称中接受类似shell的通配：

大多数equery模块接受多个输入：

一些模块还允许完整的正则表达式：

本文档的下几节将简要介绍不同的模块.

功能
要查看 equery 的全部功能，只要不加任何参数运行即可：

命令别名（Aliases）
使用  的一个常见方法是创建命令别名（aliases）. 当使用 bash 的时候这些别名（aliases）可以放到 文件中：

查找文件来自哪个包：belongs (b)
可以使用 选项搜索与正则表达式匹配的文件. 选项在找到匹配项后停止搜索，由于您的系统上的任何文件都不应归两个软件包所有，因此这是一个安全的操作.

也可以使用 的简短版本. 例如，列出所属的包：

查看ChangeLog条目：changes (c)
允许用户查看指定版本或一个范围版本的包的ChangeLog条目. 想象一下，在运行之后，Portage打印出一条消息说它将要升级. 要查看更改了什么，可以使用此命令：

验证包的完整性：check (k)
有时检查包的完整性是有用的. 可以通过验证MD5值以及时间戳来检验一个软件包是否被破坏，替换或删除.

列出依赖该包的所有包：depends (d)
Ever wonder why a certain package has been installed on the system? can tell which packages list it as a dependency with. Include indirect dependencies with the  option.

有没有想过为什么系统上安装了某个软件包？使用 可以列出哪些包依赖这个包. 使用 选项显示间接依赖项.

第二个例子列出了所有直接依赖于udev的包：

获取依赖图：depgraph (g)
is the opposite of. It will find all ebuilds that a given package depends on (not the ebuilds that depend on that package). When it finds a dependency, it will recursively search that package's dependencies. Control how deep the tree gets with the  option.

Notice how  is a direct dependency and   is an indirect dependency if the   USE is set?

Listing files installed by a package with files (f)
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 :

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

Looking for packages that have a specific USE flag with hasuse (h)
can be used to find packages with a given USE flag. will not indicate if the flag has been enabled or not; it simply outputs a list of ebuilds that have the queried flag as an option. See the EXAMPLES section of  in the  man page for more tip on getting this kind of information.

Listing packages with 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.

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

Viewing package metadata with meta (m)
Each package in the Portage tree provides at least some metadata about its maintainer, 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 a package, which can 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 command might not give the correct figure. Don't worry, 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)
'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 was typed. also accepts a versioned package to get the path to that ebuild.

Lastly, if none of the above features of have provided an answer, try using   to manually search an ebuild with programs like,  or :