The Portage Package Manager

Discussion in 'Installation' started by DevynCJohnson, Feb 9, 2014.

?

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

  1. Yes

    75.0%
  2. No

    0 vote(s)
    0.0%
  3. Maybe

    25.0%
  1. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,162
    Likes Received:
    986
    Trophy Points:
    113
    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. Ebuild compiles and installs the software packages while emerge manages repositories and dependencies. The Portage system uses a command-line interface through emerge. This means the command used to manage software via command-line is "emerge". Some GUIs exist, like Porthole and Himerge.

    NOTE: The software packages in Portage systems is usually just source code. Very few contain compiled files.

    In the Portage system, repositories can be called "portage trees" and "package trees". Additional repositories (like a PPA) 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.

    ports_hardmasked.png


    When software is being installed from the ports, the ebuild file for the desired software is read by the ebuild half of Portage. 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 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 http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-lang/ruby/ruby-2.1.0.ebuild?view=markup. This site hosts ebuilds – http://packages.gentoo.org/.

    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 -

    http://www.linux.org/threads/debian-package-management-apt-deb-and-friends.5410/
    http://www.linux.org/threads/rpm-commands-and-management.5338/

    Attached Files:

    • slide.jpg
      slide.jpg
      File size:
      36.2 KB
      Views:
      108,074
    Last edited: Mar 19, 2014

Share This Page