When you are installing Gentoo (or any other distribution, or even operating system for that matter) you make choices depending on the environment you are working with. A setup for a server differs from a setup for a workstation. A gaming workstation differs from a 3D rendering workstation.
This is not only true for choosing what packages you want to install, but also what features a certain package should support. If you don't need OpenGL, why would you bother installing OpenGL and build OpenGL support in most of your packages? If you don't want to use KDE, why would you bother compiling packages with KDE support if those packages work flawlessly without?
To help users in deciding what to install/activate and what not, we wanted the user to specify his/her environment in an easy way. This forces the user into deciding what they really want and eases the process for Portage, our package management system, to make useful decisions.
Enter the USE flags. Such a flag is a keyword that embodies support and dependency-information for a certain concept. If you define a certain USE flag, Portage will know that you want support for the chosen keyword. Of course this also alters the dependency information for a package.
Let us take a look at a specific example: the
By correctly defining the keywords you will receive a system tailored specifically to your needs.
There are two types of USE flags:
A list of available global USE flags can be found
A list of available local USE flags can be found
In the hope you are convinced of the importance of USE flags we will now inform you how to declare USE flags.
As previously mentioned, all USE flags are declared inside the
The profile your system listens to is pointed to by the
Let us take a look at this default setting for the 13.0 profile:
(This example is the sum of the settings in base, default/linux, default/linux/x86 and default/linux/x86/13.0/) USE="a52 aac acpi alsa branding cairo cdr dbus dts dvd dvdr emboss encode exif fam firefox flac gif gpm gtk hal jpeg lcms ldap libnotify mad mikmod mng mp3 mp4 mpeg ogg opengl pango pdf png ppds qt3support qt4 sdl spell startup-notification svg tiff truetype vorbis unicode usb X xcb x264 xml xv xvid"
As you can see, this variable already contains quite a lot of keywords. Do
not alter any
To change this default setting, you need to add or remove keywords to the
For instance, to remove support for KDE and QT but add support for ldap, the
following
USE="-kde -qt4 ldap"
Sometimes you want to declare a certain USE flag for one (or a couple) of
applications but not system-wide. To accomplish this, you will need to create
the
For instance, if you don't want
dev-db/mysql berkdb
You can of course also explicitly
dev-php/php -java
Sometimes you want to set a certain USE setting only once. Instead of editing
As an example we will temporarily remove java from the USE setting during the installation of seamonkey.
# USE="-java" emerge seamonkey
Of course there is a certain precedence on what setting has priority over the
USE setting. You don't want to declare
To view the final
# emerge --info
If you have altered your USE flags and you wish to update your entire system to
use the new USE flags, use
# emerge --update --deep --newuse @world
Next, run Portage's depclean to remove the conditional dependencies that were emerged on your "old" system but that have been obsoleted by the new USE flags.
# emerge -p --depclean
When depclean has finished, run
# revdep-rebuild
When all this is accomplished, your system is using the new USE flag settings.
Let us take the example of
# emerge --pretend --verbose seamonkey These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] www-client/seamonkey-1.0.7 USE="crypt gnome java -debug -ipv6 -ldap -mozcalendar -mozdevelop -moznocompose -moznoirc -moznomail -moznopango -moznoroaming -postgres -xinerama -xprint" 0 kB
# emerge gentoolkit
Now run
# equery --nocolor uses =gnumeric-1.6.3 -a [ Searching for packages matching =gnumeric-1.6.3... ] [ Colour Code : set unset ] [ Legend : Left column (U) - USE flags from make.conf ] [ : Right column (I) - USE flags packages was installed with ] [ Found these USE variables for app-office/gnumeric-1.6.3 ] U I - - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml . + + gnome : Adds GNOME support + + python : Adds support/bindings for the Python language - - static : !!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically