Portage is a
package management system
A package manager or package-management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer in a consistent manner.
A package manager deals w ...
originally created for and used by
Gentoo Linux
Gentoo Linux (pronounced ) is a Linux distribution built using the Portage package management system. Unlike a binary software distribution, the source code is compiled locally according to the user's preferences and is often optimized for t ...
and also by
ChromeOS
ChromeOS, sometimes stylized as chromeOS and formerly styled as Chrome OS, is a Linux-based operating system designed by Google. It is derived from the open-source ChromiumOS and uses the Google Chrome web browser as its principal user interfac ...
,
Calculate,
Sabayon, and
Funtoo Linux among others. Portage is based on the concept of
ports collection Ports collections (or ''ports trees'', or just ''ports'') are the sets of makefiles and patches provided by the BSD-based operating systems, FreeBSD, NetBSD, and OpenBSD, as a simple method of installing software or creating binary packages. They a ...
s. Gentoo is sometimes referred to as a ''meta-distribution'' due to the extreme flexibility of Portage, which makes it
operating-system-independent. The
Gentoo/Alt project was concerned with using Portage to manage other operating systems, such as
BSD
The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Be ...
s,
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
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), which aims to standardise and document the behaviour of Portage, allowing the
ebuild tree and Gentoo system packages to be used with alternative 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
Accessing Portage
Portage is similar to the
BSD
The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Be ...
-style
package management known as
ports, and was originally designed with
FreeBSD
FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
's ports in mind. Portage is written in the
Python programming language
Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.
Python is dynamically-typed and garbage-collected. It supports multiple programming par ...
, 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
dpkg is the software at the base of the package management system in the free operating system Debian and its numerous derivatives. dpkg is used to install, remove, and provide information about .deb packages.
dpkg (Debian Package) itself is a ...
has with
APT
Apt. is an abbreviation for apartment.
Apt may also refer to:
Places
* Apt Cathedral, a former cathedral, and national monument of France, in the town of Apt in Provence
* Apt, Vaucluse, a commune of the Vaucluse département of France
* A ...
.)
A
GTK+
GTK (formerly GIMP ToolKit and GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and prop ...
-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
In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
from
source code
In computing, source code, or simply code, is any collection of code, with or without comment (computer programming), comments, written using a human-readable programming language, usually as plain text. The source code of a Computer program, p ...
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.
Features
Emerge

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
A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
.
The program calculates and manages dependencies, executes ebuilds and maintains the local Portage
tree
In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, including only woody plants with secondary growth, plants that are ...
and database of installed packages. The compilation settings used by ebuilds can be changed through the
CFLAGS CFLAGS and CXXFLAGS are either the name of environment variables or of Makefile variables that can be set to specify additional switches to be passed to a compiler in the process of building computer software. FFLAGS fulfills a similar role.
These ...
environment variable
An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP env ...
, 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
The DVD (common abbreviation for Digital Video Disc or Digital Versatile Disc) is a digital optical disc data storage format. It was invented and developed in 1995 and first released on November 1, 1996, in Japan. The medium can store any kin ...
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'
USE Flag Index
ebuild
Gentoo does not, by default, use binary packages as other
package management system
A package manager or package-management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer in a consistent manner.
A package manager deals w ...
s do (like
pacman
originally called ''Puck Man'' in Japan, is a 1980 maze action video game developed and released by Namco for arcades. In North America, the game was released by Midway Manufacturing as part of its licensing agreement with Namco America. The ...
or apt), employing instead a format known as the ebuild. Whereas
RPM binaries are precompiled
binaries
A binary file is a computer file that is not a text file. The term "binary file" is often used as a term meaning "non-text file". Many binary file formats contain parts that can be interpreted as text; for example, some computer document file ...
, ebuilds are
shell script
A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manip ...
s with variables and functions which contain a description of the software, and instructions on how to obtain, configure,
compile, and install it, more closely akin to (but more powerful than) the
.spec files distributed in
SRPMs. The official repository provides over 19,600 ebuilds, the majority of which are distributed by the Gentoo
mirrors
A mirror or looking glass is an object that reflects an image. Light that bounces off a mirror will show an image of whatever is in front of it, when focused through the lens of the eye or a camera. Mirrors reverse the direction of the ima ...
. New and updated ebuilds can be obtained by synchronizing the local ebuild repositories with the mirrors. This is done by executing the command
emaint sync -a
. Historically, Gentoo has provided pre-compiled binary packages for many common programs, especially those which are lengthy to compile, such as
Mozilla Firefox
Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements current a ...
and
OpenOffice.org. These are still installed with emerge, just by appending a "-bin" to the package name to instead install the binary version.
Example of ebuild for
GNOME Terminator:
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_ )
DISTUTILS_USE_SETUPTOOLS="no"
inherit distutils-r1 virtualx xdg-utils
DESCRIPTION="Multiple GNOME terminals in one window"
HOMEPAGE="https://github.com/gnome-terminator/terminator"
SRC_URI="https://github.com/gnome-terminator/terminator/releases/download/v$/$.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~ppc x86"
IUSE="dbus +libnotify"
RDEPEND="
>=dev-libs/glib-2.32:2
dev-libs/keybinder:3 ntrospection dev-python/configobj dev-python/psutil dev-python/pycairo dev-python/pygobject:3 >=x11-libs/gtk+-3.16:3
x11-libs/vte:2.91 ntrospection dbus? ( dev-python/dbus-python )
libnotify? ( x11-libs/libnotify ntrospection)
"
BDEPEND="
dev-util/intltool
"
distutils_enable_tests setup.py
PATCHES=(
"$"/terminator-1.91-without-icon-cache.patch
"$"/terminator-1.91-desktop.patch
"$"/terminator-1.92-make-tests-fail.patch
"$"/terminator-1.92-metainfo.patch
)
src_prepare()
src_test()
pkg_postinst()
pkg_postrm()
Binary packages
Gentoo does have a binary packaging format, which is a ''.tbz2'' file (
tar
Tar is a dark brown or black viscosity, viscous liquid of hydrocarbons and free carbon, obtained from a wide variety of organic matter, organic materials through destructive distillation. Tar can be produced from coal, wood, petroleum, or peat. ...
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 compatible systems (with Portage's
getbinpkg
or
emerge -K
). Se
Portage Features in the Gentoo Linux Handbookfor more information.
Masking
''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
). An individual ''keyword masked'' package can be unmasked by adding a line with the full package name and keyword to some file withing the
/etc/portage/package.accept_keywords/
directory. 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.accept_keywords
as one text file.
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.
Gentoo/Alt
Gentoo/Alt is a project created to manage porting the portage framework and other features to other
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s, such as
Mac OS X
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
and the
free BSD
The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Be ...
s. Gentoo/Alt was set up by
Pieter Van den Abeele
Pieter Van den Abeele is a computer programmer,
and the founder of the PowerPC-version of Gentoo Linux, a foundation connected with a distribution of the Linux computer operating system. He founded Gentoo for OS X, for which he received a sch ...
and
Daniel Robbins after Pieter Van den Abeele founded Gentoo for Mac OS X.
Mac OS X
Gentoo for
Mac OS X
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
was the first non-Linux project of Gentoo and focused on making the Gentoo experience available on
Apple
An apple is an edible fruit produced by an apple tree (''Malus domestica''). Apple trees are cultivated worldwide and are the most widely grown species in the genus '' Malus''. The tree originated in Central Asia, where its wild ances ...
's operating system by introducing the Portage system as a separate entity. This was roughly similar to
Fink and
MacPorts
MacPorts, formerly DarwinPorts, is a package manager for macOS and Darwin. It is an open-source software project that aims to simplify the installation of other open source software. It's similar in function to Fink and the BSD ports collections ...
, but it used Portage instead of a Debian-like or Ports-like system. Later on, Gentoo for Mac OS X was made a subproject of Gentoo/Alt. The project is no longer active, because its prime assumption of using and not modifying the host OS appeared not to be realistic and eventually broke most packages or made them hardly maintainable. Gentoo for Mac OS X has been superseded by
Gentoo Prefix, which is currently what Gentoo offers to Mac OS X users.
The Prefix project on Mac OS X is tested and supported on Mac OS X Tiger, Leopard and Snow Leopard on
PowerPC
PowerPC (with the backronym Performance Optimization With Enhanced RISC – Performance Computing, sometimes abbreviated as PPC) is a reduced instruction set computer (RISC) instruction set architecture (ISA) created by the 1991 Apple– IBM ...
,
IA-32
IA-32 (short for "Intel Architecture, 32-bit", commonly called i386) is the 32-bit version of the x86 instruction set architecture, designed by Intel and first implemented in the 80386 microprocessor in 1985. IA-32 is the first incarnation of ...
, and
x86-64
x86-64 (also known as x64, x86_64, AMD64, and Intel 64) is a 64-bit version of the x86 instruction set, first released in 1999. It introduced two new modes of operation, 64-bit mode and compatibility mode, along with a new 4-level paging ...
architectures.
FreeBSD
Gentoo/FreeBSD brings the Gentoo Linux design, structure, and tools such as Portage and the Gentoo Linux base layout to the
FreeBSD
FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
operating system. Gentoo's
GNU toolchain
The GNU toolchain is a broad collection of programming tools produced by the GNU Project. These tools form a toolchain (a suite of tools used in a serial manner) used for developing software applications and operating systems.
The GNU toolchain ...
is used instead of the original FreeBSD one.
Although the project is no longer maintained by any active Gentoo developers, there are instructions that allow installation of a full Gentoo/FreeBSD system.
FreeBSD system ebuilds are integrated into the main portage tree, but this port is far from being complete due to the amount of packages needing to be ported and the lack of a proper Live CD (
FreeSBIE's Live CD or FreeBSD setup CD is used during installation).
The current (semi) official logo for Gentoo/FreeBSD is a daemonized "g", derived from original
Gentoo Linux
Gentoo Linux (pronounced ) is a Linux distribution built using the Portage package management system. Unlike a binary software distribution, the source code is compiled locally according to the user's preferences and is often optimized for t ...
logo and inspired by the
BSD Daemon
The BSD Daemon, nicknamed Beastie, is the generic mascot of BSD operating systems. The BSD Daemon is named after '' software daemons'', a class of long-running computer programs in Unix-like operating systems—which, through a play on words, tak ...
. It was designed by Marius Morawski, responding to an unofficial contest launched by Diego Elio Pettenò on his blog.
NetBSD
Gentoo/NetBSD is a project to provide a
GNU
GNU () is an extensive collection of free software
Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any ...
userland managed by Portage with a NetBSD kernel. The project was started by Damian Florczyk. Only the
x86 architecture is targeted and the system as a whole is in an incomplete state.
OpenBSD
Gentoo/OpenBSD is a Gentoo/*BSD subproject to port Gentoo features such as Portage to the
OpenBSD
OpenBSD is a security-focused operating system, security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by fork (software development), forking N ...
operating system. It was originally started by Grant Goodyear and is currently on development hiatus. An
ISO image
An optical disc image (or ISO image, from the ISO 9660 file system used with CD-ROM media) is a disk image that contains everything that would be written to an optical disc, disk sector by disc sector, including the optical disc file system. I ...
based on OpenBSD 3.8 is currently maintained by Karol Pasternak and can be downloaded from the project's web site.
DragonFlyBSD
Gentoo/DragonFlyBSD is a currently unofficial port to the
DragonFlyBSD kernel. The project is developed by Robert Sebastian Gerus.
GNU Hurd
An unofficial port to
GNU Hurd
GNU Hurd is a collection of microkernel servers written as part of GNU, for the GNU Mach microkernel. It has been under development since 1990 by the GNU Project of the Free Software Foundation, designed as a replacement for the Unix kernel, ...
was also being developed,
but was abandoned in late 2006.
Android
Led by Benda Xu, "Gentoo RAP for
Android Devices" installs a variant of Gentoo called Gentoo RAP in a directory prefix alongside Android.
The Linux kernel is used by both Android and Gentoo RAP.
[
]
Interix
Gentoo/Interix (eprefix) is a port of Gentoo that runs atop the Interix Subsystem for Windows which is also known as Microsoft Windows Services for UNIX (SFU) or Subsystem for Unix-based Applications (SUA). A result of the Gentoo/Interix project is the ability to install and use the Portage system to emerge native Windows applications (requires Visual Studio, 2008 Express Edition will do too). However, this feature does not support the wide variety of packages supported by other platforms (including Interix).
Portaris
An unofficial port to the Solaris operating system, "Portaris", was announced around 2006, but never got into a public state. It was superseded by the Gentoo Prefix project.
Plan 9
Started in 2011 as a Google Summer of Code
The Google Summer of Code, often abbreviated to GSoC, is an international annual program in which Google awards stipends to contributors who successfully complete a free and open-source software coding project during the summer. , the program is ...
project, Plan 9 For Gentoo takes the Gentoo base and overlays a userspace
A modern computer operating system usually segregates virtual memory into user space and kernel space. Primarily, this separation serves to provide memory protection and hardware protection from malicious or errant software behaviour.
Kernel ...
inspired by Plan 9 Plan 9 or Plan Nine may refer to:
Music
* Plan 9 (band), a psychedelic rock band from Rhode Island
* ''Plan 9'', an album by Big Guitars From Memphis with Rick Lindy
* "Plan 9", a song on the 1993 album ''Gorgeous'' by electronica band 808 Stat ...
. The stated objectives of the project are to have better hardware support, better software
Software is a set of computer programs and associated software documentation, documentation and data (computing), data. This is in contrast to Computer hardware, hardware, from which the system is built and which actually performs the work.
...
support and to create a "culture shock" for people that have previously used Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which i ...
systems.[ The project is maintained by Robert Seaton.][
]
See also
* pkgsrc
pkgsrc (''package source'') is a package management system for Unix-like operating systems. It was forked from the FreeBSD ports collection in 1997 as the primary package management system for NetBSD. Since then it has evolved independently; in 1 ...
* List of Linux package management systems
References
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
alternative 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 manager which can be used with ebuilds and other formats
Arch Build System
a ports-like system fo
Arch Linux
{{Package management systems
Free package management systems
Free software programmed in Python
Gentoo Linux
Linux package management-related software