How to choose USE flags?
How to choose USE flags?
Hi,
I've installed Gentoo with the "default/linux/amd64/17.1/hardened (stable)" profile.
Currently no custom USE flags are set.
I am wondering what's best practice to choose USE flags?
I guess going through this list from top to bottom doesn't make much sense.
My goal is to have a very minimal desktop configuration with X and a window manager like i3.
So I guess I could add "-gnome -kde -xfce" as a basis.
Before I install a new package, how can I see the USE flags it will be build with?
Then I can look closer to the description of these flags and either set/unset them globally or for this package only.
PS: This forum is missing an inline code BBCode.
I've installed Gentoo with the "default/linux/amd64/17.1/hardened (stable)" profile.
Currently no custom USE flags are set.
I am wondering what's best practice to choose USE flags?
I guess going through this list from top to bottom doesn't make much sense.
My goal is to have a very minimal desktop configuration with X and a window manager like i3.
So I guess I could add "-gnome -kde -xfce" as a basis.
Before I install a new package, how can I see the USE flags it will be build with?
Then I can look closer to the description of these flags and either set/unset them globally or for this package only.
PS: This forum is missing an inline code BBCode.
-
alexander-n8hgeg5e
- n00b

- Posts: 58
- Joined: Sat Nov 02, 2019 2:47 pm
- fedeliallalinea
- Administrator

- Posts: 31976
- Joined: Sat Mar 08, 2003 11:15 pm
- Location: here
- Contact:
The profiles add all you need to run correctly each one.
If you use a window manager you can choose desktop profile.
If in the time you need some use flag you can add it globally in make.conf or for single package in /etc/portage/package.use and the run emerge -UD @world command for apply new use flag to all installed packages
If you use a window manager you can choose desktop profile.
If in the time you need some use flag you can add it globally in make.conf or for single package in /etc/portage/package.use and the run emerge -UD @world command for apply new use flag to all installed packages
Questions are guaranteed in life; Answers aren't.
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Re: How to choose USE flags?
Unless some package you want to install pulls in stuff you don't want, there is no need for that.viio wrote:So I guess I could add "-gnome -kde -xfce" as a basis.
The profile you selected has those flags not enabled, so you don't need to disable them.
-
CBf9YHqgmkfqQe
- n00b

- Posts: 2
- Joined: Sat Mar 21, 2020 5:35 pm
I wouldn't start by blindly adding a whole ton of use flags until you know what they do. It's best to slowly add them over time. Start off with easy ones you know you want or don't want. For example, if you don't like KDE, you could do "-qt5 -kde" or something along those lines.
Use "emerge --preview --verbose package-name-here-lol" and it shows you all the USE flags that a specific package uses, use that tool to figure what USE flags to add or remove over time. Also if you're unsure what a specific USE flag does, the "euses my-awesome-use-flag" package is very useful, as it searches by USE flags and gives you a short description on what that USE flag does, so you can be more educated on if you should add/remove that flag from your global USE flags, or just make it program specific.
More USE flags is not better, in fact I'd argue you want as minimal as possible. Too many USE flags that are randomly added can cause conflicts in the future. Be educated with the "euses" program to be sure you really want to add it to your global USE flag.
Use "emerge --preview --verbose package-name-here-lol" and it shows you all the USE flags that a specific package uses, use that tool to figure what USE flags to add or remove over time. Also if you're unsure what a specific USE flag does, the "euses my-awesome-use-flag" package is very useful, as it searches by USE flags and gives you a short description on what that USE flag does, so you can be more educated on if you should add/remove that flag from your global USE flags, or just make it program specific.
More USE flags is not better, in fact I'd argue you want as minimal as possible. Too many USE flags that are randomly added can cause conflicts in the future. Be educated with the "euses" program to be sure you really want to add it to your global USE flag.
-
AlexJGreen
- Tux's lil' helper

- Posts: 149
- Joined: Wed Sep 19, 2018 5:37 pm
Re: How to choose USE flags?
_
Last edited by AlexJGreen on Mon Dec 28, 2020 3:15 am, edited 1 time in total.
When I first started I just compared base and desktop profile USE flags, and then chose base profile and put what I need from desktop to make.conf It were most of the flags, but not all of them. It does make sense to go through that list if you want a complete list of flags even for something you may install in the future.
I have NO-MULTILIB, but also want KDE. But there is no profile for this. So I know only one trick:viio wrote:But how could I see which flags some other profiles use?
1. Do an emerge --info and write down (or copy to a file) all used USE-Flags.
2. Then change with eselect profile to a desktop profile you wish.
3. Do an emerge --info again and save now the used USE-Flags.
3. Change back with eselect profile to your original profile.
4. Pull in all new USE-Flags in you make.conf.
-
AlexJGreen
- Tux's lil' helper

- Posts: 149
- Joined: Wed Sep 19, 2018 5:37 pm
Thank you very much for this link. I read it more than one time and I am not able to understand what is going on there ... so my solution for now is: Copying all the stuff from .../target/desktop and .../target/desktop/plasma into my /etc/portage.coderanger wrote:https://wiki.gentoo.org/wiki/Profile_(P ... g_profiles
I would like to know why it is so impossible for the gentoo developers to give us just 4 profiles more ...
You are not alone ...pietinger wrote:Thank you very much for this link. I read it more than one time and I am not able to understand what is going on there ...coderanger wrote:https://wiki.gentoo.org/wiki/Profile_(P ... g_profiles
- fedeliallalinea
- Administrator

- Posts: 31976
- Joined: Sat Mar 08, 2003 11:15 pm
- Location: here
- Contact:
If you need to combine two existing profiles it's no so complicate.coderanger wrote:Combining profilespietinger wrote:I have NO-MULTILIB, but also want KDE. But there is no profile for this.
First you should create a local overlay, after that the steps are (in this example I combine no-multilib with plasma for amd64 arch):
- create profile directory in local overlay with mkdir -p /var/db/repos/local/profiles/no-multilib-plasma, where no-multilib-plasma is the profile name
- create parent file with plasma and no-multilib: echo -e "gentoo:default/linux/amd64/17.1/no-multilib\ngentoo:default/linux/amd64/17.1/desktop/plasma" > /var/db/repos/local/profiles/no-multilib-plasma/parent
- the last step is add profile in profiles.desc with echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
Code: Select all
$ eselect profile list
Available profile symlink targets:
...
[35] local:no-multilib-plasma (dev)Questions are guaranteed in life; Answers aren't.
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Thank you very much, fedeliallalinea. You help me again. You said, I have to create a local overlay. I found some information and put them together in "Step 1", but I am not sure, if it is complete.fedeliallalinea wrote:First you should create a local overlay, after that the steps [...]
So, may I ask you again: Would be step 1 correct ? Is it all I would need (or too much) ?
--- Step 1: Creating a local repo
# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
auto-sync = false
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===
--- Step 2: From fedeliallalinea
# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
#echo -e "gentoo:default/linux/amd64/17.1/no-multilib\ngentoo:default/linux/amd64/17.1/desktop/plasma" > /var/db/repos/local/profiles/no-multilib-plasma/parent
#echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
- fedeliallalinea
- Administrator

- Posts: 31976
- Joined: Sat Mar 08, 2003 11:15 pm
- Location: here
- Contact:
Step 1 seems looks ok
Questions are guaranteed in life; Answers aren't.
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
I did it ... and had the problem with "multilib" again, but ...
... if I change the order in the file "parent", it is all OK. No "multilib" anymore 
So in step 2 it must be:
# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:default/linux/amd64/17.1/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent
So the complete procedure is:
Code: Select all
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] sys-apps/sandbox-2.13::gentoo ABI_X86="(32*) (64) (-x32)" 416 KiB
[ebuild R ] dev-util/cmake-3.16.5::gentoo USE="ncurses qt5* -doc -emacs -test" 0 KiB
[ebuild R ] sys-devel/gcc-9.2.0-r2:9.2.0::gentoo USE="(cxx) fortran (multilib*) nls nptl openmp pch (pie) sanitize ssp vtv (-altivec) -d -debug -doc (-fixed-point) -go -graphite (-hardened) (-jit) (-libssp) -lto -objc -objc++ -objc-gc -pgo -systemtap -test -vanilla" 0 KiB
[ebuild R ] sys-libs/glibc-2.29-r7:2.2::gentoo USE="multiarch (multilib*) ssp -audit -caps (-cet) -compile-locales -doc -gd -headers-only -nscd -profile (-selinux) -suid -systemtap -test (-vanilla)" 2.337 KiBSo in step 2 it must be:
# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:default/linux/amd64/17.1/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent
So the complete procedure is:
Code: Select all
# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
auto-sync = false
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===
# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:default/linux/amd64/17.1/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent
# echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
Fixing a few minor issues here to those that find this postpietinger wrote:Code: Select all
# mkdir -p /var/db/repos/local/{metadata,profiles} # chown -R portage:portage /var/db/repos/local # echo 'local' > /var/db/repos/local/profiles/repo_name # nano -w /var/db/repos/local/metadata/layout.conf ===> masters = gentoo auto-sync = false <=== # nano -w /etc/portage/repos.conf/local.conf ===> [local] location = /var/db/repos/local <=== # mkdir -p /var/db/repos/local/profiles/no-multilib-plasma # echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:default/linux/amd64/17.1/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent # echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
Shorten parent path to not reapply all of 17.1 again;
Ensure profile-formats is set;
Drop unused auto-sync;
Code: Select all
# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
profile-formats = portage-2
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===
# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:arch/amd64/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent
# echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
I am adding to this old thread because I have linked to it very often ... and there are now wiki articles:
Although “only” for DESKTOP+HARDENED, but maybe that's exactly what you're looking for.
https://wiki.gentoo.org/wiki/Hardened_Desktop_Profiles
https://wiki.gentoo.org/wiki/KDE/Harden ... ma_profile
https://wiki.gentoo.org/wiki/GNOME/Guid ... E_Profiles
Although “only” for DESKTOP+HARDENED, but maybe that's exactly what you're looking for.
https://wiki.gentoo.org/wiki/Hardened_Desktop_Profiles
https://wiki.gentoo.org/wiki/KDE/Harden ... ma_profile
https://wiki.gentoo.org/wiki/GNOME/Guid ... E_Profiles




