Portage

Portage is package manager and distribution system for Gentoo.]] It functions as the heart of Gentoo-based operating systems, providing advanced dependency resolution, flexible building and installation of software from source, and including facilities to produce, manage, and distribute binary files - among other functionality.

Portage will provision software from the, and from any , as necessary. Portage includes many for repository and package management, the primary of which is the  command.

Some common questions about portage and the command are answered in the  and the.

This article describes Portage from a user's perspective. Those looking to contribute to Portage development should visit the.

Installation
All Gentoo installations come with Portage, so there is no need to install it!.

In the rare eventuality of a corrupt or missing Portage, see the section.

Updating Portage
In order for Gentoo to stay up to date, Portage must stay up to date. Generally the usual, regular, will automatically update Portage without issue.

On occasion, updates to Portage can make it necessary to update Portage before the rest of the system. After, a message requesting this may be displayed, and it is important to follow it:

* An update to portage is available. It is _highly_ recommended * that you update portage now, before any other packages are updated. * To update portage, run 'emerge --oneshot sys-apps/portage' now.

Emerge Portage as advised (adapt the command if the message differs from this example). The  option is important, to avoid adding  to the :

If there is an issue with updating Portage, may help.

Files
The main Portage configuration is in, though there are many files used to configure Portage, mainly in the directory.

See for comprehensive documentation, notably a list of variables that can be set in this file.

The file contains many default configuration values sourced by Portage. These values can be overwritten by specifying the same variable names in.

Environment variables
Portage can be configured to a vast extent through environment variables.

See for information on available environment variables. Refer also to the in Gentoo.

To view all presently set environment variables, run:

Ebuild repositories
In addition to the , from which Portage will pull packages by default, additional are available, for example:


 * repos.gentoo.org - list of repositories contributed by the community, some by Gentoo developers
 * - official ebuild repository maintained collaboratively by Gentoo users, with a little support from a few Gentoo developers
 * gpo.zugaina.org - third-party list of ebuild repositories

The ebuild repository article has a section on to be used by Portage.

Search for available ebuilds on the command line with or.

Usage
Portage includes many different tools and utilities to help with system administration and maintenance. The following sections list these in alphabetical order.

archive-conf
The purpose of is to save off a config file in the dispatch-conf archive directory. Most users should not ever need to run this command:

dispatch-conf
The utility is used to manage configuration file updates. See the article.

ebuild
is Portage's command for running the various ebuild functions.

This command is generally not run by the user and is useful only to developers. Do not try to use it to install packages, see rather the command.

For disambiguation between this command and ebuild files, see the article.

egencache
The tool rebuilds the cache of metadata information for the ebuild repositories. See the article for additional information.

emaint
Performs package management related system health checks and maintenance.

See about how to use  to synchronize repositories. See for detailed information.

emerge
is the command-line interface to Portage and is how most users will interact with Portage.

See the article for more information on the wiki.

emerge-webrsync
Install a Gentoo ebuild repository snapshot from the web. See.

is called internally by when   in  is set to.

emirrordist
Tool for mirroring of package distfiles.

See also.

env-update
Updates environment settings automatically.

See also. See the article for some information on how the environment is set up in Gentoo.

fixpackages
Perform package move updates for all packages.

See also.

regenworld
Regenerates the file by checking the Portage logfile for all actions that done in the past.

portageq
For details see.

quickpkg
Creates Portage packages - see the for more information.

See also.

repoman
is a development tool used for testing ebuilds. Since version 2.3.0, it is packaged separately from Portage, in. See the article for additional information.

It is now deprecated in favor of and.

glsa-check
, or GLSAs, are notifications sent out to the community to inform of security vulnerabilities related broadly to Gentoo Linux or specifically to packages contained in the ::gentoo ebuild repository.

is a tool to keep track of the various GLSAs. It can be used to view GLSAs, but more importantly to test if the system is vulnerable to known GLSAs.

See and  for more information:

Main (Gentoo) ebuild repository sync time
To see when the Gentoo ebuild repository was last updated (synced), run the following command:

Corrupt or absent Portage
Although it should be very rare, as with all data, there remains a possibility that Portage could become corrupt or even uninstalled, which would be very bad for the functioning of the whole system. If ever this were to occur, there are ways Portage can be recovered, however, because Portage is so central, re-installation is a rather involved operation, requiring manual intervention to, in effect, install a package manager without having a functioning package manager.

See for details on emergency installation via binary packages. See also.

Default Gentoo ebuild repository location change
As of portage v2.3.66, which was released on 2019-04-29 , the default locations changed for the portdir , distdir , repo_name , repo_basedir directories.

For more information see bug.

Alternate package managers and GUIs

 * - Graphical Portage frontend based on KF5/Qt5.
 * - Graphical Portage frontend based on KF5/Qt5.
 * - Graphical Portage frontend based on KF5/Qt5.

External resources

 * Official Portage documentation - Built by Portage developer.
 * packages.gentoo.org - online searchable database of packages from the Gentoo package repository.

Portage man pages
The man pages contain complete technical documentation for Portage. Type in a shell on a Gentoo system to read the local man page. Note that man pages have a see also section for further information.


 * emerge - command-line interface to the Portage system - emerge man page.
 * Portage configuration files - Portage man page.