Profile (Portage)

A Portage profile Article description::specifies default values for global and per-package [[USE flags, specifies default values for most variables found in, and defines a set of system packages.]] It masks unstable package versions and USE flags. The profiles are maintained by the Gentoo developers as part of the Gentoo repository, but there are ways for users to override single pieces.

An exhaustive explanation is given in the Gentoo handbook.

Structure
All profiles are cascading/stackable profiles composed by several subprofiles. Each subprofile (corresponding to a directory under ) can contain files to set some defaults. Lower level subprofiles (e.g default/linux/amd64) also can have a file called, which pulls in one or more other higher level subprofiles (here: default/linux, arch/amd64 and base). Defaults defined in a lower level subprofile overwrites all conflicting defaults in higher subprofiles.

Following is an example for the stacked profile default/linux/amd64/13.0/desktop/kde showing the dependencies:

The following table gives a quick overview of what subprofile contain what files:

Combining profiles
If there isn't a profile in the Gentoo repository that meets your exact requirements, you can try combining multiple profiles into a single custom profile. An example of this would be combining a hardened profile with a desktop systemd profile, such as   and  . It is expected that you already have a custom repository set up.


 * 1) Create a profile name for your hybrid profile. For instance, the combination mentioned above could be named:   
 * 2) Create the directory structure in your local repository:
 * 3) Reference the profiles from the Portage tree and store them in your new profile's parent file:
 * 4) Insert the newly created profile in your repository's profiles.desc:
 * 5) Switch to the new profile using eselect:
 * 6) Run a world rebuild, but first check to make sure that the desired changes are going into effect. If not, you may need to adjust the order of the lines in the parent file:

External resources

 * [gentoo-dev [RFC] First (experimental) 17.1 profiles news item for review (v2) ]
 * Forums topic Profile 17.1
 * Forums topic Profile 17.1