Gentoolkit
Gentoolkit é um conjunto de ferramentas para facilitar a administração do sistema Gentoo, em particular do Portage.
Gentoo é uma distribuição bem particular, com certos detalhes que não estão presentes em outros sistemas. Várias ferramentas desenvolvidas para ajudar no uso do Gentoo foram criadas a partir de contribuições e são agrupadas no pacote app-portage/gentoolkit.
Gentoolkit contém ferramentas para ajudar os usuários a gerenciar os pacotes e acompanhar o que está acontecendo em seus sistemas. A maioria dos usuários, em particular aqueles que atualizam o sistema regularmente, vão se benificiar tendo o Gentoolkit instalado.
Os comandos do Gentoolkit possuem manual, digite "man <comando>" para cada comando para obter a documentação completa.
Instalação
Emerge
root #
emerge --ask app-portage/gentoolkit
euse
euse é usado para (ativar/desativar) USE flags no make.conf, sem ter que editar o arquivo diretamente. Também é utilizado para obter informações detalhadas sobre as use flags como a descrição, status das flags (ativada/desativada), tipo de flag(global/local), etc.
Para mais informações sobre USE flags, consulte o USE Flags. Utilize euse --help para para obter ajudar e todas as opções.
Invocação
user $
euse --help
euse (0.5.1-r1) Syntax: euse <option> [suboptions] [useflaglist] Options: -h, --help - show this message -V, --version - show version information -i, --info - show descriptions for the given useflags -I, --info-installed - show descriptions for the given useflags and their current impact on the installed system -g, --global - show only global use flags (suboption) -l, --local - show only local use flags (suboption) -a, --active - show currently active useflags and their origin -E, --enable - enable the given useflags -D, --disable - disable the given useflags -R, --remove - remove all references to the given flags from make.conf and package.use to revert to default settings -P, --prune - alias for --remove -p, --package - used with -E, -D, and -R to apply to a specific package only Notes: euse currently works for global flags defined in make.globals, make.defaults, make.conf, use.force, and use.mask and local flags defined in package.use and individual package ebuilds. It might have issues with cascaded profiles. If multiple options are specified only the last one will be used.
Visualizando USE flags
O comando euse -a mostra as USE flags que estão atualmente ativas e onde elas estão ativas.
There are 7 "columns" that euse uses to show whether a flag is set/unset and where the flag has been set. Upper case for set, lower case for unset:
- +/-: active or not
- "E": set in the Environment
- "C": set in make.Conf
- "D": set in make.Defaults
- "G": set in make.Globals
- "F": set in use.force
- "m": flipped in use.mask
Full positive values would be [+ECDGFm]
, full negative values would be [-ecdgfM]
, full missing values would be [- ]
.
Example euse -a output (truncated):
user $
euse -a
[...] flac [+ D ] fortran [+ D ] fuse [- ] (fuse) gbm [- ] (archive) gdbm [+ D ] gif [+ D ] gnutls [- ] (gnutls) gpm [+ D ] gtk [+ D ] gui [+ D ] hdri [+ C ] heif [+ C ] hpcups [+ C ] hwaccel [- ] (hwaccel) iconv [+ D ] [...]
Similarly the euse -a -g command is used to view active global USE flags. The euse -a -l command does the same for active local USE flags. -g
and -l
are sub-options to euse and need an option before them (like -a
) to function correctly.
Setting, and unsetting USE flags
euse is able to set, unset, or remove USE flags from make.conf. The commands used for this are euse -E flagname (enable a flag), euse -D flagname (disable a flag), and euse -P flagname (remove, or "prune", a flag).
Do not use the euse -E or euse -D commands by themselves (without a flag). It will set/unset ALL USE flags in /etc/portage/make.conf. Although a backup is kept at /etc/portage/make.conf.euse_backup, please be careful while using euse -E or euse -D!
Enabling a USE flag
Use the -E
option to enable a USE flag.
root #
euse -E 3dfx
/etc/portage/make.conf was modified, a backup copy has been placed at /etc/portage/make.conf.euse_backup
The /etc/portage/make.conf file looks like so after the command was run:
make.conf
After enabling the 3dfx USE flagUSE="alsa acpi apache2 -arts cups cdr crypt cscope -doc fbcon \ firefox gd gif gimpprint gnome gpm gstreamer gtkhtml imlib \ innodb -java javascript jpeg libg++ libwww mad mbox md5sum \ mikmod mmx motif mpeg mpeg4 mysql ncurses nvidia \ ogg odbc offensive opengl pam pdflib perl png python \ quicktime readline sdl spell sse ssl svga tcltk tiff truetype usb \ vanilla X xosd xv xvid x86 zlib 3dfx"
Disabling a USE flag
Use the -D
option to remove a USE flag.
root #
euse -D 3dfx
/etc/portage/make.conf was modified, a backup copy has been placed at /etc/portage/make.conf.euse_backup
The example /etc/portage/make.conf file, after the command:
make.conf
After disabling the 3dfx USE flagUSE="alsa acpi apache2 -arts cups cdr crypt cscope -doc fbcon \ firefox gd gif gimpprint gnome gpm gstreamer gtkhtml imlib \ innodb -java javascript jpeg libg++ libwww mad mbox md5sum \ mikmod mmx motif mpeg mpeg4 mysql ncurses nvidia \ ogg odbc offensive opengl pam pdflib perl png python \ quicktime readline sdl spell sse ssl svga tcltk tiff truetype usb \ vanilla X xosd xv xvid x86 zlib -3dfx"
euse -D does not remove flags from /etc/portage/make.conf, but adds a
-
(minus) before a flag to unset it. Use the -P
(prune) option to remove a flag. Alternatively, clean up the file manually in a text editor.A disabled USE flag is not the same as the absence of the flag in make.conf. A disabled use flag will actively disable features, whereas not listing a flag at all will use the default - enabled or disabled - as set by the package maintainer.
Remove (prune) a USE flag
Use the -P
(purge) option to remove a USE flag.
root #
euse -P 3dfx
The example /etc/portage/make.conf file, after the command:
make.conf
After disabling the 3dfx USE flagUSE="alsa acpi apache2 -arts cups cdr crypt cscope -doc fbcon \ firefox gd gif gimpprint gnome gpm gstreamer gtkhtml imlib \ innodb -java javascript jpeg libg++ libwww mad mbox md5sum \ mikmod mmx motif mpeg mpeg4 mysql ncurses nvidia \ ogg odbc offensive opengl pam pdflib perl png python \ quicktime readline sdl spell sse ssl svga tcltk tiff truetype usb \ vanilla X xosd xv xvid x86 zlib"
Other tools
revdep-rebuild
It is not necessary to run this tool for general use. The portage FEATURE preserve-libs makes the original purpose obsolete. The primary purpose of this tool is now ABI changes for specific libraries when instructions are provided by developers.
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 the broken package should be upgraded to a more recent version.
revdep-rebuild will pass flags to emerge which lets the --pretend
flag pass through, to see what is going to be emerged again before going any further.
user $
revdep-rebuild -p
* Configuring search environment for revdep-rebuild * Checking reverse dependencies * Packages containing binaries and libraries broken by a package update * will be emerged. * Collecting system binaries and libraries * Generated new 1_files.rr * Collecting complete LD_LIBRARY_PATH * Generated new 2_ldpath.rr * Checking dynamic linking consistency [ 48% ] * broken /usr/lib/gstreamer-0.10/libgsttaglib.la (requires /usr/lib/libtag.la) [ 64% ] * broken /usr/lib/libgdkglext-x11-1.0.la (requires /usr/lib/libGLU.la) [ 67% ] * broken /usr/lib/libgtkglext-x11-1.0.la (requires /usr/lib/libGLU.la) [ 85% ] * broken /usr/lib/python2.6/site-packages/gtk-2.0/gtk/gdkgl/_gdkgl.la (requires /usr/lib/libGLU.la) * broken /usr/lib/python2.6/site-packages/gtk-2.0/gtk/gtkgl/_gtkgl.la (requires /usr/lib/libGLU.la) [ 97% ] * broken /usr/qt/3/lib/libqt-mt.la (requires -lpng) [ 100% ] * Generated new 3_broken.rr * Assigning files to packages * /usr/lib/gstreamer-0.10/libgsttaglib.la -> media-plugins/gst-plugins-taglib * /usr/lib/libgdkglext-x11-1.0.la -> x11-libs/gtkglext * /usr/lib/libgtkglext-x11-1.0.la -> x11-libs/gtkglext * /usr/lib/python2.6/site-packages/gtk-2.0/gtk/gdkgl/_gdkgl.la -> dev-python/pygtkglext * /usr/lib/python2.6/site-packages/gtk-2.0/gtk/gtkgl/_gtkgl.la -> dev-python/pygtkglext * /usr/qt/3/lib/libqt-mt.la -> x11-libs/qt * Generated new 4_raw.rr and 4_owners.rr * Cleaning list of packages to rebuild * Generated new 4_pkgs.rr * Assigning packages to ebuilds * Generated new 4_ebuilds.rr * Evaluating package order * Generated new 5_order.rr * All prepared. Starting rebuild emerge --oneshot --pretend dev-python/pygtkglext:0 media-plugins/gst-plugins-taglib:0.10 x11-libs/gtkglext:0 x11-libs/qt:3 These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] media-plugins/gst-plugins-taglib-0.10.17 [ebuild R ] x11-libs/gtkglext-1.2.0 [ebuild R ] x11-libs/qt-3.3.8b-r2 [ebuild R ] dev-python/pygtkglext-1.1.0 * Now you can remove -p (or --pretend) from arguments and re-run revdep-rebuild.
To rebuild some packages run revdep-rebuild without the -p
flag and the listed packages will be emerged again.
eread
eread is a simple utility to display elog files produced by Portage since version 2.1. The saving of elog files can be enabled by setting a couple of variables in /etc/portage/make.conf:
make.conf
Enabling elogPORTAGE_ELOG_CLASSES="log" PORTAGE_ELOG_SYSTEM="save"
This is only one way of saving elog messages. For more information on how Portage's elog system works, please refer to the appropriate page in the Portage Handbook.
Once elog has been set up to satisfaction, run eread to view the log files.
user $
eread
This is a list of portage log items. Choose a number to view that file or type q to quit. 1) app-portage:gentoolkit-0.2.4_pre2:20070320-000256.log 2) app-portage:gentoolkit-0.2.4_pre2:20070320-000258.log 3) app-portage:gentoolkit-0.2.4_pre2:20070320-000319.log 4) app-portage:gentoolkit-0.2.3:20070320-000408.log Choice?
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 less. The PAGER environmental variable can be set using eselect (module pager
).
After displaying the elog item, the user will be prompted to delete the file.
eclean
eclean is a tool to remove old source files and old binary packages from the system.
When building and installing packages, the source files are downloaded and preserved in DISTDIR, usually /var/cache/distfiles. This can accumulate several gigabytes of material over time if it is not cleaned periodically. Users should run eclean-dist to clean source files from DISTDIR.
It is possible to create archives of installed packages by using quickpkg or FEATURES="buildpkg"
. These archived packages are kept in PKGDIR, usually /var/cache/binpkgs. When they are no longer needed, or if they are too old, eclean-pkg can be run to remove them from PKGDIR. It is a good way to ensure that any binary packages on the system are only the latest versions.
For more information on eclean and tips on maintaining a cruft-free system, please read man eclean or check the eclean article.
See also
- Equery
- Eclean
- Epkginfo — a tool used to display package metadata information.
- Q applets
- Useful Portage tools — provides a list of Gentoo-specific system management tools, notably for Portage, available in the ebuild repository.
This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Matt Butcher, John P. Davis, Erwin, Shyam Mani, Xavier Neys, Karl Trygve, José Luis Rivero, Joshua Saddler, Douglas Anderson
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.