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).
The smart way (re-emerges live packages only if the upstream checksum has changed):
1
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).
1
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:
1
perl-cleaner -- -vDNu1
Additionally, this also works if the script takes arguments of its own: