World Library  
Flag as Inappropriate
Email this Article

Portage (software)

Portage in action
Stable release 2.2.20 / 18 May 2015 (2015-05-18)[1]
Written in Python
Operating system Gentoo Linux and Gentoo/FreeBSD, Chromium OS, Sabayon, Funtoo Linux
Platform POSIX-compatible/Python-capable
Type Package management system
License GNU General Public License v2
Website /Project:Portage/

Portage is a package management system originally created for and used by Gentoo Linux and also by Chrome OS, Sabayon, and Funtoo Linux among others. Portage is based on the concept of ports collections. Gentoo is sometimes referred to as a meta-distribution due to the extreme flexibility of Portage, which makes it operating-system-independent.[2][3][4][5] The Gentoo/Alt project is concerned with using Portage to manage other operating systems, such as BSDs, Mac OS X and Solaris. The most notable of these implementations is the Gentoo/FreeBSD project.

There is an ongoing effort called the Package Manager Specification project (PMS)[6] to standardise and document the behaviour of Portage, allowing the ebuild tree and Gentoo system packages to be used with alternate package managers such as Paludis and pkgcore. Its goal is to specify the exact set of features and behaviour of package managers and ebuilds, serving as an authoritative reference for Portage.


  • Overview 1
    • Accessing Portage 1.1
    • Functions provided 1.2
  • Features 2
    • Emerge 2.1
    • USE flags 2.2
    • ebuild 2.3
    • Binary packages 2.4
    • Masking 2.5
  • See also 3
  • References 4
  • External links 5


Accessing Portage

Porthole graphical frontend.

Portage is similar to the BSD-style package management known as ports, and was originally designed with FreeBSD's ports in mind.[7] Portage is written in the Python programming language, and is the main utility that defines Gentoo. Although the system itself is known as Portage, it consists of two main parts, the ebuild system and emerge. The ebuild system takes care of the actual work of building and installing packages, while emerge provides an interface to ebuild: managing an ebuild repository, resolving dependencies and similar issues. (These two therefore have roughly the same relation as rpm has with yum, or dpkg has with APT.)

A GTK+-based GUI, Porthole, is available for working with Portage. There is also the Himerge GUI, which stands for "Haskell Interface for eMerge".

Functions provided

Portage is characterized by its main function: compiling from source code the packages the user wishes to install. In doing so it allows customization of compiler and target-application options to fit the system's specifications and the user's own wishes. Functionalities related to system management include: allowing parallel package-version installation, tracking cross-package dependencies, managing a database of installed packages, providing a local ebuild repository, and synchronizing of the local Portage tree with remote repositories. Functionalities related to individual package installation include: specifying compilation settings for the target machine and choosing package components.

Portage distinguishes between three levels of stability in ebuilds: stable (e.g., the software works as intended with no known security issues at time of release), keyword masked (mainly for packages that have not been sufficiently tested on the target system architecture to be considered stable) and hard masked (broken or very insecure) packages.



The emerge command-line tool is the heart of Portage. The command is customizable with many options and modifiers. The emerge tool is the most important utility for accessing the features of Portage from the command line.

The program calculates and manages dependencies, executes ebuilds and maintains the local Portage tree and database of installed packages. The compilation settings used by ebuilds can be changed through the CFLAGS environment variable, based on the specifications of the individual computer and on the user's desire for optimization. The emerge utility executes ebuilds in a sandbox environment. This way the system is protected from software executed by the ebuild and resulting binaries are only merged after a successful build and sandboxed install.

What emerge installs as dependencies is affected by the USE flag-settings. They decide which optional features will be included when installing or upgrading an application. The emerge command can also be used to download and install precompiled binary files.

USE flags

The Portage system offers the use of "USE flags", which allows users to indicate which software features they would like to include (and exclude) while building packages. For example, there is a USE flag to include DVD support, where available, in packages compiled with the flag enabled. The USE flags affect which dependencies are required, generally affecting which optional features will be built into a given program when it is compiled. For example, in packages which use a configure script, the USE flag feature would translate to ./configure --with-feature.

The specification of USE flags is the usual way to configure programs on Gentoo. USE flags may be set manually, or via user-friendly tools such as 'ufed' (USE flag editor), which lists flags along with their description. A list of available USE flags is available at the Gentoo website's USE Flag Index.


Gentoo does not, by default, use binary packages as other

Binary packages

Gentoo does have a binary packaging format, which is a .tbz2 file (tar with bzip2 compression) with additional metadata. This feature enables the building of binary packages on one system (using Portage's buildpkg or quickpkg) followed by quick installation on other, identical systems (with Portage's getbinpkg or emerge -K). See Portage Features in the Gentoo Linux Handbook for more information.


Masking is how Gentoo determines which packages are suitable for a system. Ebuilds designed for different architectures or experimental software are usually masked in a manner which prevents a stable system from installing them without user intervention.

Packages that generally just require some testing but will often work fine are said to be keyword masked (i.e. they are available for systems with an ACCEPT_KEYWORDS make.conf entry starting with the character ~, such as ~x86, ~amd64, ~ppc). The standard way to unmask an individual keyword masked package is by adding a file with the full package name and keyword to /etc/portage/package.keywords/. Users can make subdirectories here as well, allowing for custom organization. For example, if a masked package had multiple masked dependencies, the user could make a directory with the name of the original masked package, and put all the mask files for the package and its dependencies in that directory. This scheme replaces the older scheme of having /etc/portage/package.keywords as a text file list.

Packages with known problems or not considered mature enough to be candidates for stable are hard masked by one of the various package.mask files in /usr/portage/profiles, and such entries are generally accompanied by a comment from developers explaining the reason for the mask.

See also


  1. ^ "ChangeLog for sys-apps/portage". Retrieved September 15, 2015. 
  2. ^ "About Gentoo". Retrieved 27 May 2015. 
  3. ^ My Workstation OS: Gentoo | Tom Chance's website
  4. ^ Daniel Robbins (10 October 2002). "Gentoo Linux Reloaded - O'Reilly Media". Retrieved 27 May 2015. 
  5. ^ "". Retrieved 27 May 2015. 
  6. ^ Gentoo's official Package Manager Specification (PMS) project
  7. ^ Gentoo Linux Documentation - Making the distribution, Part 3

External links

Official documentation
  • Funtoo Portage Documentation
  • Gentoo Portage Features
  • Gentoo Portage Introduction
  • Working with Portage
  • Gentoo Packages, information about currently available ebuilds
Unofficial documentation
  • Gentoo-Portage, alternate presentation of current ebuild information
  • Using Portage
  • Installing portage on other Linux distros
Similar software
  • Emerde, portage-like project for Slackware
  • Pkgcore, bsd re-implementation of portage
  • Paludis, a package mangler which can be used with ebuilds and other formats
  • Arch Build System a ports-like system for Arch Linux
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.