Gentoo Linux View installed packages

Gentoo Linux View installed packages

For Gentoo Linux, you need a Equerysoftware called to view information about installed packages.

Equeryis a Portagetool used to simplify common operations.

Additionally, package dependencies, metadata, and installed files can be displayed.

how to install:

Equeryis app-portage/gentoolkitpart of a toolset installed using the package:

root # emerge --ask app-portage/gentoolkit

For more information on installation equeryor other tools, visit the Gentoolkit article.

how to use:

introduce:

equeryIs a tool that displays useful information about installed software packages on your system, equerybased on a module system.

Each module has an abbreviated name.

For example, run is the same equery l gccas run equery list gcc.

Calling --helpoptions( equery --help) will output the global options and list all available modules with their abbreviated names.

Adding the module name to the end ( equery --help module) will display help information for that specific module.

The implementation man equerywill also provide detailed descriptions of all available modules and options as well as some useful examples.

Below is a list of features available for most modules.

user $ equery --quiet list gcc

sys-devel/gcc-4.3.2-r3

user $ equery --quiet list sys-devel/gcc

sys-devel/gcc-4.3.2-r3

user $ equery --quiet list '>=sys-devel/gcc-4'

sys-devel/gcc-4.3.2-r3

Same emergeas, equerydoesn't understand part of the package name:

user $ equery check zilla

!!! No package found matching zilla

Unlike emerge, similar wildcards equerycan be accepted in category or package names :shell

user $ equery check '*zilla*'

- Checking www-client/mozilla-firefox-3.0.14 ...
   90 out of 90 files passed

user $ equery check 'www-c*/*'

- Checking www-client/links-2.2 ...
  30 out of 30 files passed
- Checking www-client/mozilla-firefox-3.0.14 ...
  90 out of 90 files passed

Most equerymodules accept multiple inputs:

user $ equery hasuse sse sse2

- Searching for USE flag sse ...
  [IP-] [ ] media-libs/flac-1.2.1-r3 (0)
  [IP-] [ ] media-libs/speex-1.2_beta3_p2 (0)

- Searching for USE flag sse2 ...
  [IP-] [ ] dev-libs/openssl-0.9.8k (0)
  [IP-] [ ] x11-libs/pixman-0.16.0 (0)

Some modules also allow full regular expressions:

user $ equery -q list --portage-tree --full-regex '[kr]?flickr.*'

dev-dotnet/flickrnet-bin-2.2
dev-ruby/flickr-1.0.2-r1
dev-ruby/flickr-1.0.2-r2
dev-ruby/rflickr-20060201
media-gfx/kflickr-0.6
[...]

Note:
Wildcard support replaces equerymany of the older options in .

For example,

To perform an operation on all packages in a collection, use '*'(asterisk).

To perform an operation on all packages in a category, use 'category-name/*'.

Warning:
When using shellspecial characters,

For example, asterisk or greater than sign, less than sign, etc. Don't forget to surround it with quotation marks.

The different equerymodules are briefly described in the next sections of this document.

Function:

To see equerythe full functionality of , just run it without any parameters:

user $ equery

Gentoo package query tool
Usage: equery [global-options] module-name [module-options]

modules (short name)
 (b)elongs list what package FILES belong to
 (c)hanges list changelog entries for ATOM
 chec(k) verify checksums and timestamps for PKG
 (d)epends list all packages directly depending on ATOM
 dep(g)raph display a tree of all dependencies for PKG
 (f)iles list all files installed by PKG
 h(a)s list all packages for matching ENVIRONMENT data stored in /var/db/pkg
 (h)asuse list all packages that have USE flag
 ke(y)words display keywords for specified PKG
 (l)ist list package matching PKG
 (m)eta display metadata about PKG
 (s)ize display total size of all files owned by PKG
 (u)ses display USE flags for PKG
 (w)hich print full path to ebuild for PKG

Command alias ( Aliases)

equery A common method used is to create a command alias ( aliases.

bashThese aliases ( aliases) can be placed  ~/.bashrc in files when used :

document ~/.bashrc

alias eqf='equery f'
alias equ='equery u'
alias eqh='equery h'
alias eqa='equery a'
alias eqb='equery b'
alias eql='equery l'
alias eqd='equery d'
alias eqg='equery g'
alias eqc='equery c'
alias eqk='equery k'
alias eqm='equery m'
alias eqy='equery y'
alias eqs='equery s'
alias eqw='equery w'

Find which package a file comes from: belongs( b)

user $ equery belongs -e /usr/bin/glxgears

- Searching for /usr/bin/glxgears ...
  x11-apps/mesa-progs-7.5.1 (/usr/bin/glxgears)

belongsOptions are available -fto search for files matching a regular expression.

-eoption stops the search after a match is found, which is a safe operation since no files on the system should be owned by two packages.

belongs A short version of ( ) can also be used b.

For example, to list equerythe packages it belongs to:

user $ equery b equery

- Searching for equery ... 
  app-portage/gentoolkit-0.3.0.8-r2 (/usr/lib/python-exec/python2.7/equery)
  app-portage/gentoolkit-0.3.0.8-r2 (/usr/lib64/python3.3/site-packages/gentoolkit/test/equery)
  app-portage/gentoolkit-0.3.0.8-r2 (/usr/bin/equery -> ../lib/python-exec/python-exec2)
  app-portage/gentoolkit-0.3.0.8-r2 (/usr/lib64/python2.7/site-packages/gentoolkit/equery)
  app-portage/gentoolkit-0.3.0.8-r2 (/usr/lib/python-exec/python3.3/equery)
  app-portage/gentoolkit-0.3.0.8-r2 (/usr/lib64/python2.7/site-packages/gentoolkit/test/equery)
  app-portage/gentoolkit-0.3.0.8-r2 (/usr/lib64/python3.3/site-packages/gentoolkit/equery)

View ChangeLogentry: changes( c)

changesAllows users to view entries for a specified version or a range of versions of a package ChangeLog.

Imagine that after running it emerge --sync, Portagea message prints out saying that an upgrade is about to happen.

To see what has changed, you can use this command:

user $ equery changes portage

*portage-2.1.6.13 (03 May 2009)

03 May 2009; Zac Medico <[email protected]> +portage-2.1.6.13.ebuild:
 2.1.6.13 bump. This fixes bug #268398 (document econf automatic die)
 and bug #267104 (handle insufficient space interaction with userfetch).
 Bug #268228 tracks all bugs fixed since 2.1.6.11.

Verify package integrity: check( k)

Sometimes it is useful to check the integrity of a package.

equeryMD5You can check whether a package has been corrupted, replaced or deleted by verifying the value and timestamp.

user $ equery check gentoolkit

- Checking app-portage/gentoolkit-0.3.0_rc7 ...
  71 out of 71 files passed

List all packages that depend on this package: depends( d)

Ever wonder why a certain package has been installed on the system?

equery can tell which packages list it as a dependency with depends.

Include indirect dependencies with the -D option.

Ever wonder why a certain package is installed on your system?

equeryUse dependsto list which packages depend on this package.

Use -Dthe option Show indirect dependencies.

user $ equery depends pygtk

- Searching for pygtk ...
  app-admin/pessulus-2.24.0 (>=dev-python/pygtk-2.6.0)
  app-editors/gedit-2.24.3 (python ? >=dev-python/pygtk-2.12)
  dev-libs/libgweather-2.24.3 (python ? >=dev-python/pygtk-2)
  dev-python/gnome-python-base-2.22.3 (>=dev-python/pygtk-2.10.3)
  dev-python/gnome-python-desktop-base-2.24.1 (>=dev-python/pygtk-2.10.3)
  [...]

The second example lists all directly dependent udevpackages:

user $ equery d udev

sys-auth/consolekit-0.4.5_p20120320 (acl ? >=sys-fs/udev-146-r1)
sys-fs/cryptsetup-1.4.1 (>=sys-fs/udev-124)
 (>=sys-fs/udev-182[static-libs])
 (<=sys-fs/udev-171-r6)
sys-fs/lvm2-2.02.88 (>=sys-fs/udev-151-r4)
virtual/dev-manager-0 (sys-fs/udev)
x11-libs/cairo-1.10.2-r2 (drm ? >=sys-fs/udev-136)

Side note:
This output will include USEoptional dependencies controlled by flags,

That is, (acl ? >=sys-fs/udev-146-r1)in the above acl USE,

Even if the USEflag is not activated.

If USEthe flag is active, the package is only a dependency.

Get dependency graph: depgraph( g)

depgraphIn dependscontrast, all dependencies of a given package will be found ebuild(rather than ebuilds that depend on that package).

When a dependency is found, the package's dependencies are searched recursively.

Use --depthoptions to control the depth of the tree.

user $ equery depgraph mozilla-firefox

- Searching for mozilla-firefox ...
- dependency graph for www-client/mozilla-firefox-2.0.0.19:
  `-- www-client/mozilla-firefox-2.0.0.19 `-- virtual/jre-1.6.0 (virtual/jre) [java]
  `-- virtual/jdk-1.6.0 (virtual/jdk-1.6.0*) `-- dev-java/icedtea6-bin (unable to resolve: package masked or removed)
  `-- dev-java/sun-jdk-1.6.0.15 `-- dev-java/java-sdk-docs-1.6.0.10 [doc]
   `-- app-arch/unzip-6.0-r1 `-- app-arch/bzip2-1.0.5-r1 [bzip2]
   `-- sys-libs/glibc-2.9_p20081201-r2 `-- sys-devel/gettext-0.17 [nls]
   `-- virtual/libiconv-0 (virtual/libiconv)
  [...]

Note that if set java USE, jreit is a direct dependency and jdkan indirect dependency.

List files installed by a package: files( f)

equeryUsing filesmodules, it is possible to list ebuildall installed files.

Try --treeto get an easy-to-read table of contents layout.

Use --filterFind to specify files of a certain type.

For example, to find where an executable is installed, use --filter=cmd, or to quickly find where a configuration file is, try using --filter=conf.

user $ equery files --tree gentoolkit

 * Searching for gentoolkit ...
 * Contents of app-portage/gentoolkit-0.3.0_rc7:
 /etc
   > /eclean
      + distfiles.exclude
      + packages.exclude
   > /env.d
      + 99gentoolkit-env
   > /revdep-rebuild
      + 99revdep-rebuild
 /usr
   > /bin
      + eclean
      + eclean-dist -> eclean
      + eclean-pkg -> eclean
      + epkginfo
      + equery
      + eread
      + euse
      + glsa-check
      + revdep-rebuild
   > /lib
      > /python2.6
         > /site-packages
            > /gentoolkit
            + gentoolkit-0.3.0_rc7-py2.6.egg-info
               + __init__.py
               > /equery
                  + __init__.py
                  + belongs.py
                  + changes.py
                  + check.py
                  + depends.py
                  + depgraph.py
                  + files.py
[...]

Another example, listing media-sound/ncmpcppall installed files:

user $ equery f ncmpcpp

- Searching for ncmpcpp ...
- Contents of media-sound/ncmpcpp-0.5.10:
  /usr
  /usr/bin
  /usr/bin/ncmpcpp
  /usr/share
  /usr/share/bash-completion
  /usr/share/bash-completion/ncmpcpp
  /usr/share/doc
  /usr/share/doc/ncmpcpp-0.5.10
  /usr/share/doc/ncmpcpp-0.5.10/AUTHORS.bz2
  /usr/share/doc/ncmpcpp-0.5.10/NEWS.bz2
  /usr/share/doc/ncmpcpp-0.5.10/config.bz2
  /usr/share/doc/ncmpcpp-0.5.10/keys.bz2
  /usr/share/man
  /usr/share/man/man1
  /usr/share/man/man1/ncmpcpp.1.bz2

For descriptions of other modules and command line parameters, please refer to equery man page ( man equery).

Look for USEpackages with specific flags: hasuse( h)

hasuseUSECan be used to find packages with a given flag.

hasuseDoes not indicate whether the flag is enabled;

Just outputs a list with query flags as options ebuild.

For more tips on obtaining this kind of information, see the Examples section equeryof the man page hasuse.

user $ equery hasuse qt3 qt4

- Searching for USE flag qt3 ...
  [IP-] [ ] app-crypt/pinentry-0.7.5 (0)
  [IP-] [ ] net-dns/avahi-0.6.24-r2 (0)
  [IP-] [ ] net-wireless/wpa_supplicant-0.6.9 (0)

- Searching for USE flag qt4 ...
  [IP-] [ ] net-dns/avahi-0.6.24-r2 (0)
  [IP-] [ ] net-wireless/wpa_supplicant-0.6.9 (0)

List packages: list( l)

listis a simple but powerful module for listing installed packages in Portagea tree or .overlay

user $ equery list '*'

- Searching for * ...
  [IP-] [ ] app-admin/eselect-1.2.3 (0)
  [IP-] [ ] app-admin/eselect-ctags-1.10 (0)
  [IP-] [ ] app-admin/eselect-esd-20060719 (0)
  [IP-] [ ] app-admin/eselect-fontconfig-1.0 (0)
  [IP-] [ ] app-admin/eselect-opengl-1.0.8-r1 (0)
  [IP-] [ ] app-admin/eselect-python-20090824 (0)
  [IP-] [ ] app-admin/eselect-ruby-20081227 (0)
  [IP-] [ ] app-admin/eselect-vi-1.1.5 (0)
  [IP-] [ ] app-admin/perl-cleaner-1.05 (0)
  [IP-] [ ] app-admin/pessulus-2.24.0 (0)
  [IP-] [ ] app-admin/python-updater-0.7 (0)
  [IP-] [ ] app-admin/sudo-1.7.2_p1 (0)
  [...]

The standard query will search for installed packages by the given package name.

Pass in '*'all packages in the display collection.

In the leftmost field, you can see that all the above packages are I(nstalled) and P(ortage) trees.

Not masked (second field is blank), loaded in default slot(0).

Use the local option to find packages in Portagethe tree and .overlays

user $ equery list -po vim

- Searching for vim ...
  [-P-] [ ] app-editors/vim-7.0.235 (0)
  [-P-] [ ~] app-editors/vim-7.0.243 (0)
  [-P-] [ ] app-editors/vim-7.1.123 (0)
  [-P-] [ ~] app-editors/vim-7.1.330 (0)
  [-P-] [ ] app-editors/vim-7.2 (0)
  [-P-] [ ~] app-editors/vim-7.2.108 (0)
  [IP-] [ ] app-editors/vim-7.2.182 (0)
  [-P-] [ ~] app-editors/vim-7.2.238 (0)
  [-P-] [ ~] app-editors/vim-7.2.264 (0)

You can see the installed versions 7.2.182and overlaythere are no available versions in .

~Users can check which versions have been blocked through the keywords in the second field .

View package metadata: 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 the package maintainer decides to provide it.

No options, metareturns some basic useful information.

user $ equery meta gnucash

- app-office/gnucash [gentoo]
  Maintainer: [email protected] (Torsten Veller)
  Upstream: None specified
  Location: /usr/portage/app-office/gnucash
  Keywords: 2.2.9-r1:0: alpha amd64 ppc sparc x86
  Keywords: 2.2.9-r2:0:
  Keywords: 2.3.8:0:
  Keywords: 2.3.10:0: ~alpha ~amd64 ~ppc ~sparc ~x86

Some maintainers provide additional information about packages, which can be very useful:

user $ equery meta --description emacs

- app-editors/emacs
  GNU Emacs is an extensible, customizable text editor - and more. At its core
  is an interpreter for Emacs Lisp, a dialect of the Lisp programming language
  with extensions to support text editing. The features of GNU Emacs include:
  - Content-sensitive editing modes, including syntax coloring, for a wide
    variety of file types including plain text, source code, and HTML.
  - Complete built-in documentation, including a tutorial for new users.
  - Support for many languages and their scripts, including all the European
    "Latin" scripts, Russian, Greek, Japanese, Chinese, Korean, Thai,
    Vietnamese, Lao, Ethiopian, and some Indian scripts.
  - Highly customizable, using Emacs Lisp code or a graphical customization
    interface.
  - A large number of extensions that add other functionality, including a
    project planner, mail and news reader, debugger interface, calendar, and
    more. Many of these extensions are distributed with GNU Emacs; others are
    available separately.

Check the package size: size( s)

Ever wondered how much space a specific package takes up?

Since packages can place files in multiple directories, the usual du -hccommand may not give the correct number.

Don’t worry, equeryit can be done!

user $equery size openoffice-bin
 * app-office/openoffice-bin-3.1.1
         Total files : 4624
         Total size  : 361.38 MiB

Use sizethe option to print 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 --bytes.

List flags for each package USE: uses( u)

equeryThe usesmodule can provide information about the flags available for a specific package USEand which flags are currently enabled.

user $ equery uses gst-plugins-meta

 * Searching for gst-plugins-meta ...
[ Legend : U - flag is set in make.conf       ]
[        : I - package is installed with flag ]
[ Colors : set, unset                         ]
 * Found these USE flags for media-plugins/gst-plugins-meta-0.10-r2:
 U I
 + + X      : Adds support for X11
 - - a52    : Enables support for decoding ATSC A/52 streams used in DVD
 + + alsa   : Adds support for media-libs/alsa-lib (Advanced Linux Sound
              Architecture)
 - - dvb    : Adds support for DVB (Digital Video Broadcasting)
 + + dvd    : Adds support for DVDs
 + + esd    : Adds support for media-sound/esound (Enlightened Sound Daemon)
 + + ffmpeg : Enable ffmpeg-based audio/video codec support
 + + flac   : Adds support for FLAC: Free Lossless Audio Codec
 - - mad    : Adds support for mad (high-quality mp3 decoder library and cli
              frontend)
 + + mpeg   : Adds libmpeg3 support to various packages
 - - mythtv : Support for retrieval from media-tv/mythtv backend
 + + ogg    : Adds support for the Ogg container format (commonly used by
              Vorbis, Theora and flac)
 - - oss    : Adds support for OSS (Open Sound System)
 + + theora : Adds support for the Theora Video Compression Codec
 + + vorbis : Adds support for the OggVorbis audio codec
 - - xv     : Adds in optional support for the Xvideo extension (an X API for
              video playback)

There are many flags enabled in gstreamerthe plugin here ,meta-packageUSE

But it can be seen that there are other flags available USE.

For more information about USEflags, see Gentoo Handbookthe USE Flagschapter.

Find ebuildthe path: which( w)

whichis a simple script that helps users quickly find ebuildfile paths.

If whichpassed an unversioned package name, ebuildthe path to the latest installable version will be returned.

In other words, if typed emerge example/package, return Portagewill be used ebuild.

whichAlso accepts versioned packages to get the path to that ebuild.

user $ equery which gnome

/usr/portage/gnome-base/gnome/gnome-2.26.3.ebuild

Finally, if none of the equeryabove functions provide an answer, try searching manually using whichprograms such as :catlessgrepebuild

user $ grep HOMEPAGE $(equery which gentoolkit)

HOMEPAGE="http://www.gentoo.org/proj/en/portage/tools/index.xml"

Warning: Please note that this currently changes the format of the output
if sent via a pipe .equery

The pipe format is intended to be easier to parse by tools, but can be  --no-pipeturned off by adding an option.

equeryBe aware of this behavior when writing scripts for use .

See also

  • Q_applets - CA small and fast Portageauxiliary toolset written in .
  • eix - A set of utilities for searching and diffing through binary caches, local Portagetrees and .overlays
  • Gentoolkit - A set of tools that simplify Gentoosystem administration.

references:

Guess you like

Origin blog.csdn.net/GaaraZ/article/details/130260671