The Portage Package Manager

Do you think the Ebuild and overlay systems can be improved?

  • Yes

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%
  • Maybe

    Votes: 0 0.0%

  • Total voters


Among GNU/Linux distros, there are many types of package managers. Gentoo uses one called Portage. Portage uses a ports-like system as seen in FreeBSD. Portage shares a lot in common with Arch's Pacman package management system. Portage is used in Gentoo and Chromium OS as well as the BSD system Gentoo/FreeBSD. Like other package management systems, it is important to understand how Portage works.

Portage is made up of two parts - ebuild and emerge. Ebuilds are scripts that compile and install the software packages. Ebuilds provide all the needed info for obtaining, patching, compiling, etc. the desired packages. Emerge manages repositories and dependencies and acts as an Portage interface. This means the command used to manage software via command-line is "emerge" just as "apt-get" is used to manage packages on Debian-based systems. Some GUIs exist for emerge such as Porthole and Himerge.

NOTE: The software packages in Portage systems is usually just source code. However, some compiled files exist. Either way, Portage is still a good package management system.

In the Portage system, the main repository is called the "Portage Tree" or a "Package Tree". Additional repositories (like a PPA in Ubuntu) are referred to as "overlays". Three types of repositories exist - stable, keyword masked, and hardmasked. The stable overlays contain well tested and stable software. The keyword-masked portage trees hold packages that are not or may not be stable or well tested. Lastly, the hardmasked-repos store software with known issues.


When software is being installed from the ports, the ebuild file for the desired software is read. The ebuild files contain information about the software, the weblink to the source code, build info, etc. The source code is downloaded and compiled in /var/tmp/portage/ (this is easy; no worries). This directory is deleted after the installation process is complete. Portage also supports binary software that does not require compilation. Such a file has the "tbz2" file extension. The ebuild files are stored in /usr/portage/ and the package trees added by the user are stored in /usr/local/portage/. To add overlays, place the ebuilds in this directory. A sample ebuild can be seen here This site hosts ebuilds –

The global Portage build settings are in the /etc/portage/make.conf script. This script creates some default settings and variables for compiling the software for the system.

To install software via Portage, use this command - "emerge PACKAGE". Software is removed using "emerge --unmerge PACKAGE". To remove unneeded dependencies, try this tool. If a programmer wants the source code for a particular application, then the source code can be downloaded through the ports - “emerge --fetchonly PACKAGE”. To refresh the overlays, type "emerge --sync" in a command-line. This allows users to see new software and updates. The repos can also be searched. This allows users to find "office" applications, they can type "emerge --search office". The command searches packages whose name contains "office", so this should find Libre-Office, Open-Office, and others. To find software whose related to "office", then type - "emerge --searchdesc office".

To update the applications on the system, try this command "emerge --update --ask @world". The "--ask" parameter produces a list of software Portage will update, but the user will be asked first. This behavior is commonly seen in Debian's apt-get command. To do a full update and update the dependencies and apply security updates, use this command - "emerge --update --deep --with-bdeps=y @world".

Now for a debate. Do you think the Ebuild and overlay systems can be improved? I think so. Mainly, I think the Ebuild system can be improved if adding an overlay were as easy as adding a PPA on Debian-like distros. Any thoughts on that?

Links to other package manager topics -


  • slide.jpg
    36.2 KB · Views: 109,716
Last edited:
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: