View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Gentoo tips & tricks

From LQWiki

Jump to: navigation, search

This is a collection of tips & tricks for the peculiarities of Gentoo.

Contents

Use flags

USE flags are the way Gentoo organizes the compile time options. This is a feature that sets Gentoo apart from other distributions. While USE flags are set during the install, you can go back and change them at anytime. If you do, make sure that you use Portage to recompile any programs that might take advantage of any use flag changes. Also, when using Portage to install new programs, you can request it to compile that program with a USE flag specifically for it. You can list them in your make.conf . See the external links below for more information.

Tools

ufed = use flag editor, emerge ufed, then run ufed as root

A problem with ufed, is that it organizes your useflags alphabetically, So if you added an experimental one by hand in your make.conf, it will be hidden amongst your countless others.

Files

/etc/make.conf has a use flag section in it.

Rebuilding what needs to be rebuilt

emerge -pev world | grep 'gtk' | awk '{print "=" $4}'

  (rac's line)
swap gtk for the useflag of you choice

The above method will work, but is extremely ineffcient. Portage comes with a command created just for this purpose. If you've added a new USE flag to your make.conf then just run

emerge --udate --newuse world

Masked packages

A lot of times you'll want to emerge a masked package (or a masked version of one). One short way to do this is ACCEPT_KEYWORDS="~x86" emerge package (replace x86 with your architecture). A slightly shorter way is to create a file called /usr/sbin/expmerge, with the following contents:

#!/bin/sh
ACCEPT_KEYWORDS="~x86" emerge $*

Then just expmerge package. Mixing unstable with stable packages can lead to problems, so it's recommended you pick one type and use it all the time. This is more important for libraries rather then programs.

NOTE: the aforementioned method of emerging masked packages is deprecated and unsupported. please use /etc/portage/ (man portage, man emerge) This is used by:

echo "package-category/package-name" >> /etc/portage/package.keywords

Emerge tips

  • emerge sync -- syncs portage with the lateset tree
  • emerge world -uDp, -- list things to be updated
  • emerge world -uD -- get almost everything updated
  • revdep-rebuild -- check for packages that break by rebuilding a dependancy
  • WARNING emerge -U -- will break your system guaranteed

Gentoo & KDE

Remember - when installing KDE on Gentoo, you don't have to install every kde package. Instead, you can simply choose to install a "small" subset of them - for example:

# emerge kdebase kdeartwork

Prior to this, if you want to check out what packages would be installed, use the --pretend option - for example:

# emerge --pretend kdebase kdeartwork | less

(As a useful alternative to --pretend, you could use the --ask option - see man emerge for more information).

N.B - As of KDE 3.4 onwards, you will be able to utilise split ebuilds - this approach enables you to install individual KDE applications, without a plethora of other KDE apps automatically being installed (as in the monolithic approach).

See also

External links


Personal tools