Why I Use Gentoo Linux

This entry is part 1 of 10 in the series Why I Use Gentoo Linux

I’ll admit it right here: Gentoo is my primary operating system and remains my favorite distribution of Linux. That’s not to say I haven’t experimented with others. Arch, Debian, Fedora and Ubuntu have all been installed on my machines at one point or another. I’ve used Exherbo, and I think it has a lot of promise. Even so, I’ve always ended up back using Gentoo. What keeps drawing me back?

To some extent, I’m sure it’s just inertia. When I finally made the switch to Linux in 2004, Gentoo was the distribution that brought me there. (I’d dabbled with other distributions prior to that, and even made a one-week switch to Debian in 2002, but needed to return to Windows to use some software for university, unfortunately.) That said, I usually enjoy change, and if something came along that was genuinely superior to Gentoo for my purposes, I have little doubt that I’d switch with little hesitation.

It seems, therefore, that there must be other reasons that I’ve chosen to stick with Gentoo. Before I list some of those, it’s worth listing some of the commonly cited reasons to use Gentoo that I don’t personally find compelling:

  • Optimization
  • USE flags
  • Learning about Linux

Each of these has some value in some situations, and I’ll expound on them in future posts, but for the moment, it’s sufficient to know that they don’t influence my decision to use Gentoo. Instead, I look to these four reasons to guide my decision:

  • Rolling release cycle
  • Simple package management
  • Unused dependency removal
  • Configuration file management
  • Development environment

None of these reasons is entirely exclusive to Gentoo. Rather, it’s the combination that makes Gentoo shine in my eyes. I will eventually get around to discussing these in more detail, but for now, the next post in this series will talk about some of those reasons that aren’t a factor in my choice of Gentoo as my primary operating system.

(Not) Why I Use Gentoo: Optimization

This entry is part 2 of 10 in the series Why I Use Gentoo Linux

One of the ways Gentoo distinguishes itself from much of the competition is its source-based nature. Most distributions provide pre-compiled binary packages to their users. Gentoo and other source-based distributions instead compile the software directly on the users’ machines during the package install process.

There is at least one major disadvantage to this approach: downloading and then compiling software is a lot slower than just downloading it. As a Gentoo user, you will often wait several minutes to several hours before you can use a new application you’ve chosen to install.

One of the oft-cited reasons to use Gentoo that supposedly makes it all worth it is the ability to customize the compiler optimization flags, or CFLAGS (and CXXFLAGS). These flags are options passed to the compiler that change how it optimizes the code.

Personally, my CFLAGS are rather mundane: “-march=native -O2 -pipe -ggdb”. It compiles code supposedly optimized for the CPU it’s running on, at a reasonable optimization level, with some extra debugging information. Some users, however, take this process to such an extreme level that they’ve earned for Gentoo users the nickname “ricers”.

Of course, optimization is not inherently a bad thing, and certain software packages will benefit from the right combination of optimization options. However, these options are most likely best determined by the developers involved, and not by the end users.

In addition, for most desktop applications, which are IO-bound (rather than CPU-bound), the performance difference between, for instance, a binary optimized for a generic i686 architecture CPU and one optimized for a Core 2 Duo will likely be unnoticeable.

In any case, while it’s nice to be able to target my CPU specifically, the ability to customize the CFLAGS and the supposed advantages have definitely been overblown. If there were a distribution that had the features I cared about, but had pre-compiled binaries instead of requiring me to wait while compiling from source, I’d probably install it right now.

(Not) Why I Use Gentoo: USE Flags

This entry is part 3 of 10 in the series Why I Use Gentoo Linux

As I mentioned in the last post, Gentoo‘s source-based nature allows it to customize software during the build process for the particular end-user or machine. One of the ways Gentoo provides to allow users to customize their builds is USE flags. These flags control the enabling or disabling of certain features in the software. (For instance, you might opt to build various multimedia packages with or without support for PulseAudio.)

This ability to easily customize features (and therefore the associated dependencies) is actually quite powerful. Users building software for an embedded platform or who wish to minimize unneeded dependencies may find the feature invaluable.

Of course, other distributions try to provide similar functionality, but implemented differently. (As a simple example, take a look at PHP. In Gentoo, you can choose to enable CGI, CLI, and Apache2 SAPIs by manipulating the USE flags. In Ubuntu, on the other hand, you’ll simply choose to install each SAPI as a separate package.) Not all uses of USE flags translate well to this approach, and as a result, I think USE flags are probably more powerful.

Unfortunately, the whole shebang turns out to be almost entirely pointless for me. I want a fully featured desktop operating system, and as a result, I end up enabling just about every flag, with few exceptions (like disabling LDAP).

Gentoo doesn’t necessarily make this process easy, either. There are a lot of USE flags, and oftentimes, it’s difficult to discern what the benefits of enabling or disabling a given flag might be. In addition, it’s relatively easy to miss out on desired functionality by not enabling some obscure flag.

The situation has been getting better over the years, as packages gained the ability to set their own defaults: common flags can be enabled by default and users who know what they are doing can disable them.

In any case, while I recognize the power of USE flags and can see why some people might find them a compelling feature, I’m afraid they don’t affect at all my decision to use Gentoo.

(Not) Why I Use Gentoo: Learning about Linux

This entry is part 4 of 10 in the series Why I Use Gentoo Linux

When it comes to reasons why people use Gentoo, a reason I’ve heard more than once is that Gentoo forces the user to learn about using Linux. On one hand, this is true, as both the install process and day-to-day maintenance of installed packages require the use of the command line. However, there are some caveats to this learning.

First, many of the commands used can be copied and pasted from the documentation, and much of it is no more than interacting with portage, Gentoo’s package installation tool. In the grand scheme of things, this is hardly a general Linux skill, and more akin to learning how to use apt on Debian or rpm and yum on Fedora.

Second, if you think that watching compiler output scroll by will teach you about Linux, you’re probably going to be disappointed. You might learn the names of a few commands, but more likely, you’re just going to be overwhelmed by all the information.

In the end, while Gentoo’s heavier reliance on command-line tools and manual configuration will force the user to learn slightly more about the underlying nature of Linux systems, a user interested in learning such things could just as easily dig deeper into an Ubuntu or Fedora system. Those of you looking for a more extreme challenge could try installing Linux From Scratch. Of course, LFS suffers from much the same “copy and paste” syndrome that other distributions do. Then again, a functional LFS system will almost certainly require substantial customization by the user.

In the end, when it comes to learning about Linux and how to use the command line, it’s probably best to open your favorite terminal program and dive right in, regardless of the distribution you’re using. At least in my opinion, it’s simply not a compelling reason to choose Gentoo over other distributions, especially given the disadvantages of Gentoo.

That said, Gentoo does have its own advantages, and starting in the next post in this series, I’ll look at some of the actual reasons I do use Gentoo.

Why I Use Gentoo: Rolling Releases

This entry is part 5 of 10 in the series Why I Use Gentoo Linux

Since the dawn of time, most Linux distributions have opted to follow a release pattern similar to most commercial software packages: release a new, updated version of the product every few months or years. This pattern is comfortable for many developers, as it gives them a chance to work on new features without worrying about the initial damage it will cause, followed by a bug fixing phase when the product is polished for release.

Meanwhile, you’ll find that Gentoo has no real concept of a release. They do release a new version of the official live CD every so often, but the only change is an update of the tools used on the CD. Regardless of the age of the live CD, the end result will be the same: a fully functional Gentoo system.

Instead, for each architecture, Gentoo has two release targets: stable and testing (arch and ~arch, respectively). New versions of packages are generally put into testing first. After at least thirty days (in most cases) with no problems, they are marked as stable. What does this whole process mean for the end user? There are some noted advantages:

  • You get access to new versions of your software shortly after they come out. When a new version of a program such as Firefox or Pidgin is released, you’ll often be able to install the new version within a day or so.
  • Since software is always being upgraded, the upgrades happen in small bits. This allows major changes to be handled one at a time, rather than wrestling your way through a bundle of changes every six months.

However, there are also some disadvantages:

  • Because the current versions of various packages are always changing, there is little opportunity for the system as a whole to be tested. This results in occasional instability, especially if you try to mix packages from the stable and testing targets. This kind of problem seems to more rare than it has in the past, but that could be entirely in my head.
  • Because there is no release deadline, and developers make no official attempt to synchronize with upstream release cycles, major software packages can be slower to be updated. In particular, Gentoo seems to be perpetually about three months behind on updating GNOME.

There are other distributions which also offer a rolling release. Arch is often more updated than Gentoo. Exherbo is extremely bleeding-edge, though as it has matured, it’s become less so. Fedora offers its Rawhide branch, with which I unfortunately have too little experience to comment on extensively. With Debian, you have access to Sid. Of all of these, Gentoo does the best job of keeping the rolling release stable for everyday use.

Gentoo gives me the best combination of up-to-date packages with overall stability, and this is perhaps the most influential reason as to why I use Gentoo. I keep hoping another major distribution will move to a rolling release, but that’s probably mostly wishful thinking. Some are better than others about keeping non-core packages up to date in the current release, but in the end, I still feel like Gentoo gives me the best overall experience.

Why I Use Gentoo: Simple Package Management

This entry is part 6 of 10 in the series Why I Use Gentoo Linux

Regardless of which distribution you’re using, one situation seems to come up for everyone eventually: discovering that the official repositories either lack a package you want to install or that the version available is out of date. When this happens, it’s left to you, the intrepid end-user, to find a way to install that deeply coveted package.

One approach is to scour the internet for a third-party package. With Ubuntu and its relatively recent introduction of PPAs, this has actually become a relatively productive path. As time goes on, finding packages on Linux has become increasingly easy, even if they’re not in the official repositories.

If this fails, however, the only remaining option is to create a package yourself. One of the reasons I like Gentoo is that its version of this process can be ridiculously simple. The hardest part is creating your local overlay. Once this is done, bumping the version of a package is often as simple as renaming the file and reinstalling the package.

Gentoo installs packages by following the directions in files called ebuilds. Ebuild syntax is relatively simple, and for packages with standard build systems, creating an appropriate ebuild is very easy. As a result, even adding new packages to your system (or patching existing ones) need not be frustrating. Installing a package from your local overlay is exactly the same as installing one from an official repository. All packages are first-class citizens on Gentoo.

With many other distributions, it’s certainly possible to build your own packages, but it certainly has a second-class citizen flavor. Arch has its PKGBUILD system, and Debian has excellent tools for creating .deb packages. Nonetheless, Gentoo’s system seems simplest and the most integrated, but perhaps it’s merely my biased experience talking.

As time has passed and finding packages (from both the official repositories and third-parties) has become easier, this reason has become less relevant. Nonetheless, I still find myself maintaining a small local overlay, and Gentoo’s flexibility in this area is one reason I’ve chosen it as my primary distribution.

Why I Use Gentoo: Unused Dependency Removal

This entry is part 7 of 10 in the series Why I Use Gentoo Linux

Perhaps with the exception of Slackware, today’s modern distributions have completely mastered the fine art of installing a package’s dependencies automatically. The installation of a package and all its required dependencies is no more difficult than a single command.

However, there does occasionally come a time when I decide to uninstall a software package I previously had installed. If only the package itself is removed, all of its now unused dependencies will be left behind. Over time, this unused cruft accumulates, wasting disk space and causing superfluous upgrades of these unused packages.

Gentoo’s key innovation in this area (and one of the many reasons I use it) is something called the world set. The world set is nothing more than the set of packages that were explicitly installed by the user. If a package is neither in the world set nor a direct or indirect dependency of another package that is, it can (in theory) be safely uninstalled. Thus, the system is kept free of unused dependencies.

In addition, all distributions come with a default set of packages have a core set of system packages that probably shouldn’t be removed. Gentoo calls this the system set, and this set is assumed to be part of the world set. As a result, system packages and their dependencies are never automatically removed.

This feature isn’t entirely exclusive to Gentoo. Aptitude, the popular front-end for apt, Debian’s package management system, has long had the ability to mark packages as either manually or automatically installed, removing unused dependencies as necessary. In addition, in the past few years, apt gained the ability to natively track this information, making apt as capable as Gentoo’s portage in this regard.

However, at least to my mind, Debian’s packaging makes the use of this feature somewhat more difficult. Instead of a single metapackage to install a default GNOME desktop environment, the user must mark as manually installed several packages in the GNOME desktop environment task. Ubuntu elegantly solves this problem through its ubuntu-minimal, ubuntu-standard and ubuntu-desktop packages, which allow you to simply mark the default system as manually installed. (Of course, if you want to remove a single package from the default system, you’re out of luck. I’ve never had that problem, however.)

In the end, Ubuntu seems the most comparable to Gentoo among the major distributions. I’m not even sure Fedora has a good equivalent, but I’d love to hear about it if it does. In any case, while this particular feature isn’t as much of a reason to use Gentoo as it was five years ago, it’s still one of the reasons I use Gentoo. On the other hand, a rolling release Ubuntu would be that much closer to getting the ultimate nod.

Why I Use Gentoo: Configuration File Management

This entry is part 8 of 10 in the series Why I Use Gentoo Linux

Behind the scenes of any Linux distribution is a teeming morass of configuration files. Most desktop-oriented distributions, such as Fedora and Ubuntu, elect to hide this configuration behind various graphical configuration utilities.

Unfortunately, several times when I’ve been using Ubuntu, during software upgrades, I’ve been prompted to deal with configuration file changes, even on configuration files that I’ve never modified. This seems like a rather unsightly blemish on an otherwise excellent desktop-oriented distribution. Perhaps it’s just my bad luck.

Of course, as a user of Gentoo, I’ve actually become quite familiar with many of the system configuration files. With distributions like Gentoo and Arch, you’re much closer to the core of the system, and it often is necessary to configure things by directly editing the configuration files. With new packages often installing new versions of these files, keeping everything up to date has the potential to become nothing short of a nightmare.

Fortunately, Gentoo has a mature solution to this problem that works quite well. By default, your system configuration files are protected from modification during package installation. After the installation is complete, you are notified that there are configuration files that need updating. At this point, you can use any number of console-based or graphical utilities to merge the changes in the files.

Arch’s approach is similar, but last time I used it, there was no default utility to aid in the merging process, leaving the user to manually find the new configuration files and update them. There are utilities available, such as dotpac, but having the programs more readily available would definitely help. Perhaps things have changed by now.

In any case, this isn’t particularly an important reason I use Gentoo, but rather a feature I find helpful when it comes to dealing with the inevitable configuration file upgrades.

Why I Use Gentoo: Development Environment

This entry is part 9 of 10 in the series Why I Use Gentoo Linux

Some of us in the computer world aren’t just users—we’re developers too. Whether we’re working on personal projects or large software packages, we find ourselves in need of various programs and data required for software development, such as compilers and library headers.

On most Linux distributions, these extra files are not installed by default. They take up space, and for most users, they will be completely useless. I’m not about to chastise any distribution for making that decision. Nonetheless, for those of us who do need these tools and data, finding a simple way to install them is paramount.

With Debian-derived distributions such as Ubuntu, you can solve part of this problem by installing the build-essential package, which ultimately has dependencies on a number of tools useful for development. However, this still leaves the matter of installing the library headers and other package-specific development files. Most distributions address this part of the problem by offering dev packages, which install the files necessary for developing against the associated package.

If you’re working on a package that’s in the repository, you can use a utility like apt-get build-dep to install all of the packages needed to build that package. However, if you’re working on a personal project, you’ll still have to manually select all the appropriate development packages. In addition, this whole process tends to wreak havoc with one’s list of manually-installed packages.

Generally, each dev package must be marked as manually-installed, or else they may be removed by the package manager as unused dependencies. This quickly leads to a more unwieldy list of packages and a greater chance for cruft in the future. Since I prefer to keep this list as small and tidy as possible to minimize the number of unused dependencies that hang around, Ubuntu’s solution seems cumbersome at best. That’s where Gentoo steps in.

Since Gentoo is a source-based distribution, packages are compiled directly on the user’s computer. This means all of the files necessary to build a package are already installed by default. In essence, a Gentoo system is always a complete system ready for software development. As I’m routinely compiling personal projects, this is incredibly beneficial to my workflow.

All that said, binary distributions could solve this problem by simply allowing the user to tell the package manager to treat all build dependencies as required, much as you already can with recommended dependencies. Sure, it probably wouldn’t be a good idea to set this option by default, since it would lead to increased disk usage and longer upgrade times, but for many developers, this option would be incredibly useful. Perhaps such an option already exists or has recently been added to distributions such as Ubuntu and Fedora.

For the moment, however, it seems as if Gentoo is the best all-around distribution for software development on Linux. That is one of the more important reasons I prefer Gentoo as my primary desktop distribution.

Why I Use Gentoo: Conclusion

This entry is part 10 of 10 in the series Why I Use Gentoo Linux

Of all the myriad Linux distributions out there, I’ve chosen Gentoo as the one to use on my primary desktop computer. Throughout this series, I’ve talked some of the reasons that I enjoy using Gentoo. As an incredibly brief summary, Gentoo fits my needs as a developer-oriented distribution with rolling upgrades.

That’s not to say that Gentoo is necessarily my favorite distribution in every arena. For most users who require nothing more than a functional, top-notch desktop distribution, I think Ubuntu is still at the forefront. Its non-rolling release cycle means that the user won’t necessarily have the latest versions of packages and must deal with a major upgrade every few months, but those are largely painless.

The distribution that, in my mind, shows the most promise, however, is Exherbo. A source-based distribution similar to Gentoo, it won’t ever be the right choice for everyone. However, I think that it takes the best of Gentoo and does it better. It’s not quite stable enough to use as my primary desktop distribution, but its development over the next couple of years will be exciting to watch, nonetheless.

While I have given a number of specific reasons that I use Gentoo, in the end something called familiarity plays a key role. I’ve become very accustomed to using Gentoo, and learning another system and its quirks can be a non-trivial task. Nevertheless, I like to try new things, and look forward to the day when another distribution finally supplants Gentoo on my desktop.