Chymeric Tutorials

Do awesome stuff - awesomely.

Portage Cheat Sheet

| Comments | Edit

This is a small sample of commands dealing with a series of simple use cases involving Portage. For all the code examples please note that emerge needs to be run as root. Other commands such as equery can be run as user. The Gentoo Wiki hosts a longer (though different) Portage/Gentoo cheat sheet on this page.

Re-emerge all live ebuilds

The hackish way (re-emerges all packages versioned 9999).

emerge -av `eix -Jc | grep 9999 | cut -d" " -f2 | tr "\n" " "`

The smart way (re-emerges live packages only if the upstream checksum has changed):

emerge @smart-live-rebuild

Emerge stuff using only one core

This is useful if the package is prone to breakage when using parallel processing (some things can become required before they are compiled).

MAKEOPTS=-j1 emerge -vaDNu chromium

Pass Portage options to scripts

Some scripts (like revdep-rebuild or perl-cleaner) check the portage tree and the packages on your machine, and then pipe an emerge command for Portage. Mostly they emerge -vD1 *, you can usually add more arguments via --. Like so:

perl-cleaner -- -vDNu1

Additionally, this also works if the script takes arguments of its own:

perl-cleaner --all -- -vDNu1

What package pulls in foo?

equery b foo

See all packages in world

cat /var/lib/portage/world

Find out what package said file belongs to

qfile /path/to/file