Gentoo Cheat Sheet

This is a reference card of useful commands for administrating Gentoo.

Portage Package Management
Sync the Portage tree using the mirrors by fetching the latest differences:

Sync the Portage tree using the mirrors by obtaining a Portage snapshot that is at most a day old:

Sync the overlay and Portage tree:

List what packages would be installed without installing them:

Install a specific version of a package:

Remove a package and the dependencies that no other packages depend on:

Remove a package but not its dependencies:

Check for and rebuild missing libraries

Remove no longer needed packages:

Upgrade the selected packages, dependencies and deep dependencies that are outdated or have USE flag changes:

Tell which installed package provides a command.

Tell which packages depend on cat/pkg:

Get information about a package:

A graphical user interface to use with the Portage tree:

Manage configuration changes after an emerge completes:

Rebuilds packages that depend on an recently updated library:

USE flags
Obtain descriptions and usage of the USE flag X:

Obtain a description of the png USE flag:

Show what packages have mysql use flag option:

Show what use flags are available for a specific package:

Quickly add a required USE flag for a package install

Typical Administration
Obtain root shell (if the current user is listed in the sudoers list):

Start the ssh daemon in the default runlevel at boot:

Start the xdm service now:

Check if the sshd service is running or not:

Important Files

 * : Global settings (USE flags, compiler options)
 * : USE flags of individual packages
 * : Keyword individual packages; e.g. ~amd64, ~x86, or ∼arm
 * : Accepted licenses
 * : List of explicitly installed package atoms
 * : Contains for every installed package a set of files about the installation

External resources

 * Original gentoo-cheat repository
 * Forum post about gentoo-cheat