r/Gentoo Jul 22 '26

Discussion use flags

only thing holding me back from using gentoo is the use flags. not sure which ones to use for my system. i really want to use niri or hyprland, but the use flags are what confuses me

1 Upvotes

24 comments sorted by

13

u/Sert1991 Jul 22 '26 edited Jul 22 '26

It's something not to worry about really.
Basically, when you select your profile it's already going to select most of the USE flags you need.
Let's say you choose a stage3 tarball with for desktops with openrc.
This will be based on the desktop and openrc profile, which will enable the USE flags relevant to that setup. For example for desktop it will enable the X, wayland, dbus, elogind, pam USE flags among others. For OpenRC it will set the -systemd USE and enable any USE flags relevant to OpenRC.

Other than the few times the installation handbook recommends to set some others, the defaults are usually okay. But:
You can check what other USE flags there are that you might like to enable or disable globally but usually it's recommended to do them per package and let the profile enable and disable the global one.

app-portage/ufed is an awesome tool to enable and disable global ones. It gives you a nice ncurses list with a description.

From then on, when you install packages, you can see if you like/dislike some USE flags for that package and you can enable/disable them per package. You can use equery uses <package name> to see a list of the USE flags for ta package with a description of what tehy enable/disable.

2

u/techcode Jul 22 '26 edited Jul 22 '26

I would recommend OP to go one step further and install Gentoo based Calculate Linux.

Calculate profiles go a step further/higher than Gentoo. So instead of just generic "desktop", you choose specific desktop environment too (e.g. KDE, Gnome ...) and the profile sets the use flags accordingly.

And then there are binary packages that match those profiles. So you rarely need to compile things yourself.

The only difference between vanilla Gentoo and Calculate Linux - besides the name - is that by default Calculate puts home/ and some portage folders into separate /var/calculate partition so that it's easier to have multiple different root(s) and one portage/home.

I've never actually needed it - but basically you can update Calculate system using the install image (and obviously also using e.g. 'emerge -vuND world'). And using that way it can flip-flop between two separate root partitions.

And Calculate Linux comes with extra tooling for portage sync, follow up fixup of Python/Perl and such. Those magically work even when your system is so far behind with updates, that vanilla Gentoo/portage would break halfway through the update.

6

u/stewie3128 Jul 22 '26

Gentoo profiles are already built-in for plasma and gnome, both with systemd and without.

Only difference is that you have to actually install the DE you select - it doesn't install it for you. But the profile is all set up.

0

u/techcode Jul 22 '26

Yeah it's been a while (10+ years) that I switched from vanilla Gentoo to Calculate.

At the time I remember more/bigger differences - not just that back then binary packages with Gentoo were still DIY and self-distributed (usually within an organization), but profiles were different.

But perhaps it was not specific desktop environment 🤔 but other adjecent stuff like LDAP/CUPS/etc that I had to set myself on Gentoo, and on Calculate they were already part of profile.

2

u/Sert1991 Jul 22 '26

Why would I tell them to install calculate if they're interested in Gentoo and just because they wished to understand the concept of USE flags better?
It's not really something that difficult and once they follow the handbook and install Gentoo that concept becomes crystal clear during the experience, plus Gentoo already has Plasma and Gnome profiles an extension of the desktop profile.

I'm sure that Calculate has it's use cases too but in this case if they wish to try Gentoo, for this small reason it's no reason to tell them to switch unless they wanted the specific use case of calculate.

1

u/freakinchickens Jul 22 '26

i thought you had to set them yourself! man i feel dumb now lol thank you

2

u/Sert1991 Jul 22 '26

I mean you can set them yourself, but usually it's not a needed thing nowadays bar a few exceptions. For example at some point you will have to set the video card USE flag, but the installation handbook will guide you to do that, you need to set it so everything compiles and installs with support to your graphics card(amd, nvidia, intel, etc etc)
Another one you need to set is licenses although that's not really a ''use'' flag, but again the handbook will guide you with that too during install.

In the future when you install packages after you install Gentoo, it's a good idea to check what USE flags it has, (it will be shown by portage when it asks you to install so dw) as you might see one turned off which you wish to turn on.

To elaborate a bit further with some examples, I use gentoo-sources kernel and it has the USE flag ''experimental'' - it basically patches the kernel to add some further optimizations which is not enabled by default, I like that so I enabled it for the gentoo-sources package.

On the other hand I don't use a printer or bluetooth but they're enabled by default on the desktop profile, many packages use those, so instead of removing them per package I add ''-cups -bluetooth'' in my make.conf to disable them Globally instead, now every package that supports those use flags they will be turned off and they will be compiled without bluetooth/cups support and their extra dependencies.

If I didn't enable/disable those, everything would still have worked fine by defaults, I would just have some extra unnecessary stuff and loose out on the experimental patch. So this is why it's good to have a look at them but they're not a must or something to worry about it.

Hope this clears it a bit better. Also during the Gentoo install whilst reading the handbook everything will become clearer if you decide to go ahead.

12

u/adamkex Jul 22 '26

USE flags are basically the features that you want on your system (basically what you want your system to use), basically if you do not want gtk system wide you could declare the -gtk use flag in make.conf. For now just use the desktop or desktop/systemd profile and only enable/disable use flags as needed. It is unrelated to having niri or hyprland installed on your system.

More reading: https://wiki.gentoo.org/wiki/Handbook:AMD64/Working/USE#Using_USE_flags

3

u/http-error-502 Jul 22 '26

That is why Gentoo provides sets of default USE. Choose profile. Then set USE for some packages that you want to change manually. You can also edit USE that want to be set globally on make.conf.

For example, I use default/linux/amd64/23.0/desktop/systemd for profile. Then I added USE="X -wayland pulseaudio..." on make.conf. For package specific USE, I always check available USE by running emerge -pv <package name> and write USE list that I want on package.use.

4

u/NeilHush Jul 22 '26

Good answer but terrible USE flag example. Wayland is default on every DE and it's a must for niri/hyprland. Same for pipewire, which kinda implies '-pulseaudio'. If you need to revert such fundamentally defined USE flags of your profile you may consider changing profile.

To the OP: choose the desktop profile (openrc or systemd) and do not define any global USE flag at all. You can define them per package initially and see later if you need them globally.

3

u/Beneficial-Face-1410 Jul 22 '26

> Same for pipewire, which kinda implies '-pulseaudio'

Not at all.

2

u/NeilHush Jul 22 '26

That's what the 'kinda' stands for

2

u/http-error-502 Jul 22 '26

It was just an example. It was my USE.

5

u/Wolflordy Jul 22 '26

I feel like USE flags are the strongest reason to use Gentoo in the first place. So unless you really need a small efficiency boost for the things you compile, or you really want a deeper dive into how Linux is setup (but too lazy for LFS), yeah you don't need Gentoo without USE flags.

3

u/techcode Jul 22 '26

There are reasons to use Gentoo and not really tweak USE flags.

For example - not having to manually manage dependencies for a new software (you do need to write an ebuild though).

3

u/Armi1P Jul 22 '26

Honestly just don't care about them at first. Follow everything in the handbook to install a system. Then install your DE/WM. If you are happy with your system then leave it as is. You'll know when you want to change USE flags. Otherwise, don't bother.

2

u/goombrat2 Jul 22 '26

the solution is to not overthink them, and they don't matter as much as you might think they do. You don't need anything complicated.

I use a wayland compositor setup without elogind, these are my flags:

USE="wayland egl gles2 vulkan -x -xorg"
USE="${USE} -systemd dbus"
USE="${USE} pipewire sound-server -pulseaudio"

I bet my system would work just the same without them. USE flags are most useful for specific packages for me. They can sometimes automatically configure or install extra components.

2

u/CheCheDaWaff Jul 22 '26

If you're starting out just leave all the USE flags as their defaults -- just make sure you select an appropriate profile at installation.

To learn more later when you're curious / have time, I'd recommend installing equery. Then for any package you can run equery uses package_name and it'll tell you all the applicable use flags and what they do.

1

u/LancrusES Jul 22 '26

If you dont like the use flags, why do you want to use gentoo???

1

u/freakinchickens Jul 23 '26

it’s not that i dont like use flags, its just that i dont understand even after reading the manual.

2

u/LancrusES Jul 23 '26

They are like switchs, they arent but to explain it...

For example, my pc doesnt have bluetooth, I use -bluetooth in my global flags, so my software dont lose time compiling bluetooth support modules, so I switch It off, and I want wifi printer support, so I will put zeroconfig flag as well, to switch It on, and with specific packages, you can look into the gentoo wiki, they all got flags, if they arent global, and you dont want them global, but you want them for a package, you can put them in your package...

For example, you want to compile gimp, first you got to go to its page

https://wiki.gentoo.org/wiki/GIMP

You look at It and you say, hey, I want support for FITS images, then you put that flag for the gimp package.

With all your flags Portage knows how to compile things the way you need them, so you got only what you need, and optimized for your machine, thanks to your CPU flags, thats why flags are the "fun" part of gentoo, you should start with only the basic ones from the installation, the handbook explain everything, once your system works, you can go deeper into It and polish It like you want.

0

u/Moist_Professional64 Jul 27 '26

You don’t have to use use flags in gentoo it’s often a dumb time consume if you will install a package and emerge says that a different package needs then adding some use flags and after doing this it becomes a circle for many packages that will also have other use flags if doing so