Any tips for Gentoo Portage flags?

Hi, I guess I’m bored so installed Gentoo :grin: Actually third time but now I have decided to learn the emerge and use flags. Last two times I just went ahead and tried to install a DE etc without trying to get the /etc/portage/make.conf right. Any tips? At the moment I have use flags "X and then a lot of minuses like -cups -wlan -bluetooth…

Should I just leave the make.conf USE flags as is at the moment and start using /etc/portage/package.use?

Any tips welcome! Thanks!

Hi @ihasama ,
Welcome. You are doing well getting Gentoo installed, it is more difficult than most other distros.

You have to think about what the USE flags are for.
They signal to the compiler that you want (or dont want) certain facilities built into your Gentoo system.
Each package can be built with or without some software libraries. The flags available for each package are documented.
The flags set in make.conf are global. For example, if you set
-systemd you will build a Gentoo entirely without systemd… no package will use it.
The flags in package.use are specific to the nominated package. For example you may want gimp to
support png images.
It is generally considered a good idea to keep use flags in make.conf to a minimum, and to do most of your flag setting in package.use.
In most packages you can take the default flags… ie dont set any flags. It is only when you want some non-default libraries compiled into a package that you need the use-flag setting .

The use-flag facility is why every Gentoo install can be unique.
Each profile has a set of flags built in. It is worth looking up what is set by your profile, so that you only bother to set things which vary that

Regards
Neville

2 Likes

Hi Neville

Thank you for the reply! So am I right that you’re saying that if I don’t add the flags for a package it will still build the package right? Let’s say installing vim. I go to the Vim - Gentoo wiki to see USE flags but I don’t necessarily need to add them to the package.use?
But I can add them/disable some of them and modify as per my needs? So basically just choose if I build a whole package or leave something out?

I hope you understood my question. Thanks for the help!

Br
Pete

2 Likes

Right, they are options. You can choose whether to add (or delete) something. Otherwise you take the profile’s default.

It is a confusing concept. It us all about what gets compiled into the package when you emerge it. For each package there is a default, and you can vary it to include more or less than the default.

Sometimes you need to fiddle with flags to deal with dependency issues like circular dependencies. Tackle that when/if you encounter it.

1 Like

Thanks! Your replies are very helpful! I have had issues with circular depencies last time I installed Gentoo. Probably because I added all those flags to the make.conf🙄

One quick question: if there’s an error when emerging @world on one package it won’t stop every other packages upgrade?

I had emerge world running at home today and it seems it has finished ok but there’s one error on x11-libs/pango. I have followed the handbook and only added x11 to the point I can check it works. No window manager/DE yet.

Not sure. I dont have much experience with Gentoo.
If it does stop while emerging world, you can simply fix the issue then redo emerge world. Dont forget to sync before emerging world.

The technique for breaking circular dependencies is to use the flags to compile the parts of a packsge that dont need the offending dependencies.

Very sensible. Get X working before you try a WM or a DE.
You can test X with startx.

Here’s what I did when I installed Gentoo Linux for the third time (first time was a mess-up, second survived, third after getting a new computer).

Install the base system, including logging, cron daemon, etc. I used nano and eselect to edit configuration stuff. My phone for browsing the gentoo wiki.

Then I set all use flags on KDE (I was using that one) and installed KDE (the gentoo wiki has instructions for it).

After that I set more detailed USE-flags, some on a per-package basis, and did a emerge -uvDN @world. After this the system should be ready for use. Circular dependencies aren’t that hard to deal with, you just need to read portage’s errors, they’re self-explanatory.

btw: app-portage/eix is a really nice tool to have. Also, use eselect whenever possible; it’s a gift from the heavens that will definitely help with configuration in all kinds of ways.

Yes, I do this

eix-update
eix-sync
emerge --ask  --oneshot portage
emerge -avuND world

There are various ways

Thanks Xander and Neville! Will check the eix and try your way of updating/upgrading the world.

First two installs I made from Arch chroot and the third time used the Gentoo live iso with the handbook as guide. X is working but still no DE. Logging and cron daemon not installed. I’m trying to install Cinnamon DE because I’ve used to it. Just need to get thrue the emerge -avuND @world without errors first.

1 Like

First cleaned the make.conf, only “X -wireless -kde and so on” then I tried to update the x11 pango package and then installed eix and continued the upgrade according to the instructions from Neville. Fingers crossed…

@ihasama
Where exactly are you at with this Gentoo install?

It’s emerging the world at the moment. Build 10/61. There’s nothing more than the handbook install, xorg working, user with sudo, neofetch😁 and that’s it. Next step would be login greeter and cinnamon de.

Edit: emerge @world successfully done :partying_face: I think it’s enough for today. Backup next. Thanks!!!

Edit2: cinnamon working and firefox.bin also :partying_face:

1 Like

At the moment I have timeshift working and have tried to restore with success. Everything else works but I still need to login first and then startx. Have tried few window managers but no luck yet. I have cinnamon desktop. Don’t mind if I need to login and startx but a greeter would be nice🙄

I use Mate DE and lightdm for the display-manager.

IceWM is probably the best WM. It is almost as good as a DE.

LightDM is a good choice for login manager. Otherwise SLiM,
but it takes a bit of getting used to.

I used sddm as instructed in the Gentoo wiki and all is well. I really like the Gentoo wiki!

1 Like

Yes, the Gentoo wiki is a fantastic resource.

For a logger I can recommend syslog-ng, it’s really flexible. Don’t forget logrotate too (or could syslog-ng do that function too… don’t remember). Have fun configuring all that stuff. If vim is a bit too much for you, nano is a really good text editor.

Also, if your machine is turned off after use, install fcron for a cron daemon. It doesn’t reset after boots, so the time keeps counting through reboots (sorry for the poor explanation, perhaps someone else can explain better than me).

Don’t forget to configure all this stuff.

Oh, most important, there’s a tool which you absolutely, positively need 100% (iirc). It’s needed for SSDs, was it called fstrim or something? Dump it in cron.daily and your SSD should be happier a while longer.

It’s best to install all this stuff before you start doing stuff with X.

1 Like

Hi Xander,

thanks for all the info! I use nano all the time. Just used Vim as an example for emerge and flags. It’s my HTPC and only powered on when needed. Need to check fcron and also fstrim.

I have already installed X, greeter, cinnamon de, timeshift (also tried that I can restore to a snapshot) and also got the PIA wireguard working.