User: Password:
Subscribe / Log in / New account


News and Editorials

Gentoo Package Management with Portage

June 9, 2004

This article was contributed by Ladislav Bodnar

Before Gentoo Linux emerged (pun intended) as a powerful force on the Linux distribution scene, software installation on most distributions was a subject of much controversy and frequent criticism. The RPM package manager was often at the receiving end of the blame due to its complex dependency structures; typing "rpm dependency hell" into Google's search engine returns over 700 entries. Debian's implementation of its own package management was often seen as technically superior to those found in RPM-based distributions, but many potential users were put off by Debian's other complexities and a lack of graphical installation and configuration utilities. And while Slackware's own package management does not suffer from dependency issues (simply because it doesn't care about them), many will argue that its pkgtool and other package utilities are rather too basic to qualify as a package management tool in the true sense of the word.

Enter the world of Gentoo Linux. With one short command, a user can install any application, without ever having to worry about libraries and other dependencies. The command will download the source code of the requested package, it will also download the source codes of all the dependent packages (if any), then it will configure, compile and install the package(s) without any further intervention on the user's part. Because the vast majority of packages are compiled directly from source code (with some exceptions, such as OpenOffice, Java, Opera, etc.), the user has complete control over package versions, optimizations, even optional dependencies, in some cases. In fact, the only drawbacks when compared to binary package management tools are longer installation times and fairly stringent hardware requirements - the pleasure of using Gentoo Linux rises exponentially with the power of the CPU at hand.

Portage. The main force behind Gentoo's convenient package management is Portage. Written in Python, Portage not only provides the all-important "emerge" command, it also groups all packages, or ebuilds in Gentoo speak, into a logical tree-like structure in /usr/portage/. Ebuilds can be unmasked, masked or hard masked, with unmasked ebuilds considered stable and well-tested, while masked ebuilds are stable, but not yet tested extensively. Hard masked ebuilds are usually reserved for alpha or beta packages. Only unmasked packages are installed by default, but this can be overridden either in /etc/make.conf or on the command line like this:

# ACCEPT_KEYWORDS="~x86" emerge packagename

The list of current masked packages is stored in /usr/portage/profiles/package.mask. To see the available versions of a package and their masked status in a nicely colored output, we can use the etcat command (part of the gentoolkit package):

# etcat -v mozilla

USE-flags. The USE-flags is a very clever concept, serving as a central place to configure some of the most basic aspects of the operating system and its behavior. As an example, if you prefer to have support for ALSA for all the relevant applications, you have to specify it as a USE-flag. Once done, these applications will be compiled with ALSA support included. If you don't specify it centrally in /etc/make.conf, you would have to compile the applications with the following command:

# USE="alsa" emerge xmms

The above example is still useful in case a user wants to override the global setting. There are over 200 USE-flags listed in /usr/portage/profiles/use.desc; they provide many "uses" that range from Java and SELinux support to specifying the default Japanese input server or enabling potentially offensive items in packages. The USE-flags also specify one of the CPU architectures - the currently available choices include x86, ppc, ppc64, sparc, alpha, mips, hppa, arm and amd64.

CFLAGS. Much has been said about CFLAGS on various forums, especially by those who never read the GCC manual. Probably the most important decision here is the use of march or mcpu when specifying the type of processor. The former will result in faster binaries at the expense of compatibility, while the latter will be produce somewhat slower binaries, but will cover a wider range of processors. As an example, specifying -mcpu=i586 will result in binaries optimized for i586, but they will also execute on i386; however specifying -march=i586 means that the binaries will only execute on i586, but not on i386 CPUs. Another common CFLAG is -O, which specifies a level of optimization ranging from -Os (optimized for small binaries) to -O1, -O2 or -O3 (optimized for speed). GCC provides over a hundred different CFLAGS.

Examples. Finally, let's have a look at some practical examples to illustrate the range of available options in Portage. The handful of the commands listed below are just a tip of the iceberg.

# emerge-webrsync

This is the same as emerge sync (it synchronizes the local portage tree with the latest available portage tree on official repositories), but useful for those users who are behind a firewall blocking the standard rsync port 873

# nice -n19 emerge -u world

This is the same as emerge -u world (it updates all installed packages to their latest available versions), but with a low priority so that the compilation process has a limited effect on the user's ability, in terms of processor resources, to perform other tasks.

# emerge -pv packagename

Lists packages that are dependent, but not yet installed, on packagename.

# emerge /mnt/cdrom/packagename*tbz2

Installs a binary package packagename from the mounted CD-ROM.

# emerge info

Lists all the Portage-specific variables, such as USE, CFLAGS, COMPILER, GENTOO_MIRRORS, etc.

If you are used to the rpm command, you can install Gentoo's epm to query packages. It takes many of the same arguments as rpm itself:

# epm -q packagename

Returns the installed version of packagename

# epm -qa

Returns all installed packages

# epm -qi packagename

Returns information about packagename

# epm -Va

Checks the integrity of all installed packages and reports conflicts

# epm -e packagename

Uninstalls packagename, same as emerge unmerge packagename

Learning about Portage is a journey in itself, a road paved with many pleasant surprises behind every turn. There is no doubt that Portage is one of the most powerful package management utilities available today.

Comments (28 posted)

Distribution News

Gentoo Linux

The Gentoo Weekly Newsletter for the week of May 31, 2004 is out. This issue covers the release of Wasabi, and several other topics.

Here's the announcement for the release of Wasabi 0.1, a custom log monitoring tool for Gentoo systems.

Comments (none posted)

Xandros releases downloadable version

Xandros has announced the availability of an "open circulation edition" of its distribution. "'We want the Open Circulation version of the Xandros desktop to replicate like a virus,' said Dr. Frederick H. Berenstein, Xandros Chairman and CTO. 'Open computing is coming of age, and every desktop user should know that there's a full-featured Windows alternative out there, and they're going to love it!'"

Comments (2 posted)

Lycoris Desktop/LX 1.4 Presales Available

The Lycoris Desktop/LX 1.4 (formerly known as Update 4) is now available. Click below for the full press release.

Full Story (comments: none)

up2dateiso v1.1.0 release

Version 1.1.0 of up2dateiso has been released. This is a Python program that takes a set of distribution CD iso's and updates the rpms on them with the latest rpms from the updates archive. RH9, FC1 and now FC2 are supported.

Full Story (comments: none)

Distribution specific GNOME releases

Footnotes reports the release of Dropline GNOME 2.6.1 for Slackware and ULB GNOME 0.8.0 for SuSE Linux 9.1.

Comments (none posted)

DistroWatch Weekly, Issue 52

The DistroWatch Weekly for June 7, 2004 looks at Damn Small Linux extensions, and several other topics.

Comments (none posted)

Fedora Core

Fedora Core updates:
  • FC1 - strace 4.5.4-0.FC1: new upstream version
  • FC1 - vim: upgrade vim to the latest patchlevel, fixes a lot of minor issues
  • FC2 - cups: fixes several problems
  • FC2 - strace 4.5.4-1: new upstream version
  • FC2 - bison: new upstream version (fixes bug #116823)

Comments (none posted)

Mandrakelinux updates drakxtools

Mandrakelinux updates the drakxtools package to correct various bugs, for Mandrakelinux 10.0.

Full Story (comments: none)

Slackware Linux

The -current branch of Slackware has several upgraded packages, an assortment of other changes and bug fixes and a new rzip-2.0. Upgrades this week include man-pages-1.64, mod_ssl-2.8.18-1.3.31, gaim-0.78, mdadm-1.6.0, clisp-2.33.2, gcalctool-4.4.8, gnome-icon-theme-1.2.3, totem-0.99.12, elm2.5.7, ImageMagick-6.0.2-2, xine-lib-1-rc4a, parted-1.6.11, php-4.3.7, cdrdao-1.1.9, vim-6.3.0, strace-4.5.4 and xchat-2.0.9. The Linux kernel 2.6.6 source package is in testing. See the slackware-current changelog for complete details.

Comments (none posted)

New Distributions

Knoppix 64

Knoppix 64 is a 64 bit Debian based release for 64 bit AMD machines. The initial release, v3.4-EN-2004-05-31, is remastered from KNOPPIX 3.4. The goal of this work is to provide a 64 bit development environment along with the usual desktop tools. Language support includes English, French and German.

Comments (none posted)


OpenSLS (or Open Secure Linux Server) is currently a concept work-in-progress. It's aim is to be a secure Linux OS based on Mandrake Linux. Unlike Corporate Server, which is a fine server operating system, OpenSLS will be much more scaled down with a lot of additional security features. OpenSLS 1.0-CURRENT alpha1, released June 3, 2004, is based on Mandrake Linux 9.2 with a lot of cleanup and enhancements.

Comments (none posted)

Minor distribution updates

AGNULA/DEMUDI 1.2.0-beta0 released

The first beta release of AGNULA/DeMuDi 1.2.0 (a Debian-based distribution aimed at audio and video applications) is now available. Click below for the details.

Full Story (comments: none)

Astaro Security Linux

Astaro Security Linux has released v5.011 with minor bugfixes. "Changes: This Up2Date improves the backend performance and fixes bugs for V4 and V5 backup, content filter configuration, for RSA connections with X.509 and RSA keys, user authentication, network definitions, and uplink failover. It also adds the configuration ability to bypass the content filter/HTTP proxy if needed."

Comments (none posted)

Buffalo Linux

Buffalo Linux has released v1.2.3 with minor bugfixes. "Changes: This release includes upgrades to 30 base packages, 21 extra packages, and 15 GNOME packages. The CD now recognizes a previous Buffalo version that supports upgrading (version 1.20 or higher). More minor desktop upgrades were made, including integration of gqview as the icon selector. A 68MB upgrade from 1.2.2 is also available for download."

Comments (none posted)

Feather Linux

Feather Linux has released v0.5 with major feature enhancements. "Changes: This release is based on Knoppix 3.4, and thus many improvements have been made. MADWIFI, prism54, and speedtouch drivers are now included, and superior hardware support is found throughout. The GIMP script has been fixed. This release removes picocom, adds ncrypt and minicom, reincludes ndiswrapper, adds tcc documentation, and adds scripts to install Ruby, Python, Folding@Home, and GIMPS."

Comments (none posted)

Gibraltar Firewall

Gibraltar Firewall has released v2.0 with major feature enhancements. "Changes: This is a new major release with many changes, focusing on content inspection. HTTP, SMTP, and POP3 traffic can be checked for viruses (clamav and Kaspersky anti-virus) and SPAM, HTTP and POP3 even transparently. User authentication for HTTP has been added, either via user lists or by integrating with MS Active Directory. The base system has been updated, and is now based on a hardened and enhanced 2.4.26 kernel which includes additional firewall match modules (e.g. the P2P traffic match module)."

Comments (none posted)


GoboLinux has released v011 with major feature enhancements. "Changes: This release features the introduction of Compile, a new source-based compilation system. Other distinctive features were the switch to the 2.6 kernel series (2.4 is still included), the adoption of the XOrg X11 server, and a large number of upgraded packages."

Comments (none posted)

LEAF - Bering-uClibc

LEAF (Linux Embedded Appliance Firewall) has released Bering-uClibc 2.2-beta3 with major feature enhancements. "Changes: This release introduces a new flexible module loading scheme, is updated to shorewall 2.0.2f, replaces dnscache and dhcpd with dnsmasq, and has some bugfixes."

Comments (none posted)

Linux From Scratch

Linux From Scratch has released v5.1.1 with minor bugfixes. "Changes: This release fixed several release-process related problems and minor spelling and grammatical errors. The package and patch versions remain unchanged." Beyond Linux From Scratch (BLFS) v5.1 is also available.

Comments (none posted)

Linux LiveCD

Linux LiveCD has released v1.9.4 with major feature enhancements. "Changes: This release adds Frottle (Freenet Throttle) packet scheduling and QoS for wireless networks and mesh WiFi at /opt/frottle. There is a new default config for MRTG graphical network statistics, and updated documentation."

Comments (none posted)

Recovery Is Possible!

RIP has released v9.0. "Changes: Some of the software has been updated, and the download site was changed for faster downloads. There's also a script, to enable installing and booting the system on a USB flash drive."

Comments (none posted)

Tao Linux

Tao Linux has released v1.0 Update 2. "Changes: All current updates to 5/31 were rolled into new set of ISO images. Kernels for i586 and Athlon are included. Development packages are included in the Everything install. Trademark fixes were made for Eclipse and Squirrelmail."

Comments (none posted)


ThinTUX has released v0.15 with major feature enhancements. "Changes: This release replaced glibc with uclibc."

Comments (none posted)

Distribution reviews

Moving from Debian To SuSE Linux and Back Again (OSNews)

This OSNews article compares Debian with SuSE Linux. "I switched from Windows to Linux about 4 years ago when I finally found a distribution that didn't annoy me, Debian. It required a bit of manual tweaking but I always found that the important things "Just worked". Well after 3 years of just working, I finally rode my installation into the ground through a combination of kernel upgrades and running a diverse mix of packages from the "unstable", "testing", and even "experimental" branches of Debian. It got to the point where KDE would boot unbearably slowly, applications would fail to start, and my mouse and keyboard would stop working if I didn't use them for a few minutes. After much fiddling I finally decided a reinstall would be the path of least resistance. Since I'd been hearing all these fantastic reviews for Suse 9.1 I thought I would give it a try; after all it sounded like this was finally a no-nonsense, "just works" distribution for the fabled average user."

Comments (3 posted)

Page editor: Rebecca Sobol
Next page: Development>>

Copyright © 2004, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds