Portage

is Gentoo's package manager. It is installed by default as part of the stage3 install process. See the Gentoo Handbook for more details.

Installation
In the case the system somehow does not have Portage (maybe it became corrupted or it was accidentally removed) there are ways it can be recovered.

Here are a few viable solutions in order for a system administrator to get Portage (back) on a system:
 * 1) Have a friend or a build server build Portage binaries build, then transfer them to the broken machine. This could be done using the  Portage feature on a healthy machine or by using the quickpkg command. See the binary package guide for more information.
 * 2) Manually download a copy of a recent Portage release via tarball, build it, and manually install it. The administrator will have to perform all the work that Portage world normally automate. This option could be easier than the first option, and may potentially take less time.
 * 3) Boot up a LiveDVD/CD that has Portage included (Gentoo LiveDVDs or SystemRescueCD should contain Portage). Remove the old or broken Portage and reinstall install Portage to the mounted root filesystem (potentially the fastest and easiest option in the case of a fast internet connection and available CDs/DVDs). For example, if the root file system with broken Portage was mounted at the following commands could be used from a live environment.
 * 4) Change all of Portage's relevant environment variables to be set to the Portage directory of the mounted root filesystem. If the broken Portage root directory is mounted at, the command would look like this:
 * 5) Run the emerge command in order to remove any traces of the old broken Portage package:
 * 6) Sync the Portage Tree in case the system is a bit behind on the current Portage tree:
 * 7) Install the new version of Portage:

Overlays
In addition to the official repository (colloquially known as the "Portage Tree" because of its traditional placement in ), there are additional repositories which in Gentoo are called overlays.


 * Gentoo Overlays: Users' Guide
 * Layman homepage
 * Browse overlays

It is possible to search through the ebuilds available in the overlays on http://overlays.gentoo.org/ by using the eix tool.

Command-line interface: emerge
emerge is the command-line interface to the Portage system. This is how most users will interact with Portage. The emerge command has many possible options. For a complete list of all options see its man page:

Below you see an exemplary invocation of emerge. The options are shortcuts for ,   and. They trigger  to ask before proceeding, display the dependency tree of packages to be installed, and to be verbose with its output. While in the context of Portage, the term "package" can also be referred to as an "atom." Don't be confused if you see the term "atom" used instead of the term "package."

GUI interfaces
There are a few GUI interfaces that exist for Portage, although some of them have become unmaintained.

Maintained


 * A GTK+-based frontend to Portage.


 * Graphical Portage frontend based on KDE4/Qt4.

Unmaintained

kport

Alternatives to Portage

 * An alternative package manager written expressly for Gentoo-based systems.

Relevant Gentoo Wiki pages

 * GCC optimization
 * Useful portage tools
 * Binary package guide
 * Portage tips
 * /etc/portage configuration files
 * Repository format
 * ebuild
 * Package Manager Specification
 * Overlay
 * Category:Portage
 * Gentoolkit

Related sections of the Gentoo Handbook

 * A Portage Introduction
 * USE flags
 * Portage Features
 * Files and Directories
 * Configuring through Variables
 * Mixing Software Branches
 * Additional Portage Tools

Other official docs

 * q applets