Gentoolkit/en

Gentoolkit is a suite of tools to ease the administration of a Gentoo system. This document covers the basics of some of the tools present in Gentoolkit.

What is gentoolkit?
Gentoo is a unique distribution and presents some complexities that simply do not exist for other distributions. As Gentoo developers and contributors discovered some of these complexities, they also wrote tools to help users and administrators work around them. Many of these tools have been contributed to the Gentoo project and are included in the package.

Gentoolkit contains a whole bunch of useful tools to help users manage packages and keep track of what is going on in their systems. Most users -- particularly those who update systems often -- will benefit from having gentoolkit installed.

Installation
Just as with any Gentoo package, installation is just a simple emerge.

Finding documentation
Any documentation that a program might have (other than man pages) is stored in.

Introduction
equery is a tool that displays useful information about the installed packages on the system. equery is based on a system of modules. Every module has a shorthand name. For example, running equery l gcc is the same as running equery list gcc. Invoking the  option ( equery --help ) will output global options and list all available modules and their shorthand names. 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.

Below is a list of features that work over the majority of modules.

Like emerge, equery does not understand partial package names:

Unlike emerge</tt>, equery</tt> can accept shell-like globbing in the category and/or package name:

Most equery modules take multiple input:

A few modules also allow full regular expressions:

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

Finding the package that a file came from with 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.

Viewing ChangeLog entries with changes (c)
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:

Verifying package integrity with check (k)
Sometimes it is useful to check a package's integrity. equery</tt> can verify MD5 sums as well as timestamps to indicate when a package might have been corrupted, replaced, or removed.

Listing all packages depending on a package with 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.

Getting dependency graphs with depgraph (g)
is the opposite of. A package is passed and it will find the packages that package depends on (not the packages that depend on that package). When it finds a dependency, it will recursively search for all of 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)
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.

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 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.

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.

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.

Viewing package metadata with meta (m)
Each package in the Portage tree provides at least some metadata about its maintainer, herd, etc. Read about Gentoo Metadata. The amount of useful information depends on how much package maintainers decide to provide. With no options,  returns some basic useful information.

Maintainer's providing extra information about the package 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 du -hc 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 equery</tt> have provided an answer, try using  to manually search an ebuild with programs like cat</tt>, less</tt> or grep</tt>:

Introduction
euse</tt> is a tool to see, set and unset USE flags at various places. For more information on USE flags, please refer to the USE Flags. See euse -h for complete help and all options.

Viewing, setting, and unsetting USE flags
The <tt>euse -a</tt> command reads the current active USE flags and displays them.

Similarly the <tt>euse -a -g</tt> command is used to view active global USE flags. The <tt>euse -a -l</tt> command does the same for active local USE flags. and  are suboptions to <tt>euse</tt> and need an option before them (like  ) to function correctly.

<tt>euse</tt> is able to set or unset USE flags. The commands used for this are <tt>euse -E flagname</tt> (enable a flag) and <tt>euse -D flagname</tt> (disable a flag).

Enabling a USE Flag:

The file looks like so after the command was ran:

Disabling the USE flag:

Again, the file after the command:

revdep-rebuild
This tool is Gentoo's Reverse Dependency rebuilder. It will scan the installed ebuilds to find packages that have become broken as a result of an upgrade of a package they depend on. It can emerge those packages for users automatically but it can also happen that a given package does not work with the currently installed dependencies, in which case you should upgrade the broken package to a more recent version. <tt>revdep-rebuild</tt> will pass flags to <tt>emerge</tt> which lets you use the  flag to see what is going to be emerged again before going any further.

To rebuild some packages run <tt>revdep-rebuild</tt> without the  flag and the listed packages will be emerged again.

glsa-check
<tt>glsa-check</tt> is mainly a test tool that keeps track of the various GLSA's (Gentoo Linux Security Advisory) and will eventually be integrated into <tt>emerge</tt> and <tt>equery</tt>.

eread
<tt>eread</tt> is a simple utility to display elog files produced by >=. The saving of elog files can be enabled by setting a couple of variables in :

Once you've set up elog to your satisfaction, just run  to view your log files.

Select a number and the file will be displayed using the paging program specified in the PAGER environment variable. If PAGER is not set, it will use <tt>less</tt>. The PAGER environmental variable can be set using <tt>eselect</tt> (module ).

After displaying the elog item, you will be prompted if you want to delete the file.

eclean
<tt>eclean</tt> is a tool to remove old source files and old binary packages from the system.

Building and installing packages, the source files are downloaded and preserved in, usually. This can accumulate several gigabytes of material over time if it is not cleaned periodically. Users should run <tt>eclean-dist</tt> to clean source files from.

It is possible to create archives of installed packages by using <tt>quickpg</tt> or FEATURES="buildpkg". These archived packages are kept in PKGDIR, usually. When they are no longer needed, or if they are too old, <tt>eclean-pkg</tt> can be ran to remove them from. It is a good way to ensure that any binary packages on the system are only the latest versions.

For more information on <tt>eclean</tt> and tips on maintaining a cruft-free system, please read man eclean or check the eclean article.