I am installing KDE on a Gentoo Linux Hardened system. The official Gentoo wiki says the recommended way is to apply the KDE desktop profile, issue emerge -NDu --with-bdeps=y @world
, and then install the kdebase-meta
package. However, I am on the Hardened profile and apparently I can only have one selected profile at once.
So far I've been successful with manually applying the KDE profile's global and per-package USE flags on my Portage configuration files (/etc/portage/make.conf, /etc/portage/package.use and stuff), but I fear this hack might be rather difficult to maintain in the long run as the Gentoo dev team modifies the profile. Every time I get a Portage update, I'd have to reapply the desktop
and desktop/kde
profiles' USE flags and configuration just in case they were changed.
Is there any other way to have multiple active Portage profiles at once on Gentoo Linux?
Best Answer
Problem
As you have discovered, Gentoo only allows one Profile Setup at a time. As you can see from my
eselect profile list
:Solution
Having set your profile to hardened (14 on my list), we now need to examine the files for the KDE Profile: (note that this takes a bit of writing without a text editor):
cd /usr/portage/profiles/targets/desktop/kde
nano -w make.defaults
nano -w parent
/usr/portage/profiles/targets/desktop/
.nano -w make.defaults
Using Scratch Paper, copy down the USE Flags from Step 2, and opening
parent
in Step 3 reveals..
, which now means we travel one directory up. Copy the USE Flags from Step 5. As the final step, issueemerge -v app-portage/ufed && ufed
. You can now set the USE Flags you copied down in/etc/portage/make.conf
. You may want to repeat the process for:/usr/portage/profiles/desktop/kde/package.use
/usr/portage/profiles/desktop/package.use
by placing the packages listed in those two files into
/etc/portage/package.use
.During Syncs, files in
/etc/portage
will not be overwritten and the USE Flags in/etc/portage/make.conf
will mimic the behavior you are trying to achieve. See the Portage Files Section in the Handbook for more information. In essence, your Portage overrides in/etc/portage
will add to your hardened profile, as Portage uses your configuration before it reads your selected profile. I know it's a pain as the USE Flags in the profilespackage.use
files can be updated with each sync, so you will need to see if any are added after each sync. Generally, the profile files aren't updated very often.