Gentoo Emerge Guide

Portage, package management, flags and related notes.

(Also July 2014)

Some of my opinions on how to go about building up your Gentoo system. There are probably other views, but these hints should keep you relatively sane.

DON’T - Start off by trying to emerge things with massive dependency trees. Start off small with the shell utilities you’re going to need later. You’ll get manageable USE flag options this way, and should be in a much better place to take on the larger installs later once you have your basic flags set up.

ALWAYS always always use –ask (or -a) with emerge. Take your time to check the flags you’re using. Cancel the emerge, go read up on them, set the ones you want and try again.

Grab this early on:

ufed - A very handy tool for flipping use flags on and off rather than editing the make.conf file by hand. It neatly sorts them alphabetically, leaves the rest of your config file alone, and even adds sane line breaks for you. Better yet, it gives you one line descriptions of what the flags actually do.

Now go for something like mplayer, ffmpeg, pulseaudio or alsa. You’ll get a nice long (but manageable) list of potential USE flags. The basic audio, graphics and processor flags will need to be worked out. It’s a good place to start before you take on X and your desktop of choice.

After every few installs at this stage, while you’re merrily adding and removing USE flags, you need to run this mystic set of 3 lines:

emerge --ask --update --deep --with-bdeps=y --newuse @world  
emerge --ask --depclean  
revdep-rebuild  

It will go back though installed packages, check your flag changes, clear out bits you don’t need any more, and then add in any new dependencies you’ve created. Occasionally it will also scream at you because you’ve managed to set conflicting flags for some packages. Don’t panic. If you’re running that clean up routine fairly regularly, it should be trivial to pick out the one or two flags you need to flip to make it all happy again.

Other handy hint: If you’ve just flipped a lot of flags to get something new installed with all the features you want, it’s worth cancelling the emerge (you are using –ask right?), then running the 3 line tidy up code before you go ahead. It’s just a sanity check that you’re not about to install something with a set of flags that breaks your existing installation.

Personal opinion: I tend not to use - (omit) flags if at all possible. You don’t gain very much by using them in terms of code size or speed, and you increase the chances of breaking a requirement later on if you put them in.

Want to see what flags a package uses without using emerge?

equery u

Want an alternative search to “emerge -s/S”?

qsearch -s “



qsearch -S “”

Don’t forget to set LINGUAS and VIDEO_CARDS in your make.conf fairly early on. LINGUAS in particular can give you a long recompile if you add it in late.

There’s way more. Gentoo wiki is your friend for more detailed breakdowns, but if you stick to that basic methodology, you won’t go far wrong.

Finally, you’ll fast realise it’s fairly pointless asking other people what flags they use. It’s very user centric, depending on hardware and personal preferences for apps, desktops and libraries. Don’t fight it. Don’t try and shortcut it. This is why and how Gentoo ends up being a finely crafted system for your own particular tastes and set up.

 
1
Kudos
 
1
Kudos

Now read this

A mini VKWorld Stone V3S mobile phone review

Sighs… Ok here we go. If you avoided buying the Lingwin N1 in the last mini review, you might have spotted the VKWorld Stone V3S at a bit above that price range. It’s this thing here: http://www.vkworld.cc/product/v3s You might also want... Continue →