LWN.net Logo

A quick look at Gentoo Linux

Your editor recently needed to set up a sacrificial box for testing out code for the driver porting series. Installing a system like that is always a good opportunity to try out a new distribution, so it seemed like the right time to try to get a sense for what the Gentoo hype is about.

Little did he know that it would take a week just to get through the installation process.

Gentoo seems to be positioning itself as a Debian for the real hackers. So, for example, most of the distribution is built from source at installation time. Why? So you can control the configuration and optimization settings, of course. As a result, the process can take a while, especially if the system you are installing is relatively old and slow.

But, in fact, it takes some time to get even that far. A look at the 1.4rc3 installation instructions is a sobering experience; it takes a while just to read about all that must be done. You start with a bootable CD image, of course, but then it's a matter of:

  • Figuring out and loading whatever kernel modules are necessary to make your system work.

  • Configuring networking - perhaps by hand.

  • Going into fdisk to set up partitions.

  • Running variants of mkfs as many times as necessary to create your filesystems - be sure to get the partition names right.

  • Mounting the filesystems by hand.

  • Untarring an archive with the base system on it.

  • Issuing a manual chroot command to move into the under-construction system's filesystem.

  • Running the nice emerge tool, which will bring your base system up to date with the current packages.

  • Editing /etc/make.conf to set options on how the rest of the system will be built.

  • Running emerge again to download and build the bulk of the system. Good time to head out for coffee. Or, on slower systems, a nice weekend.

  • Choosing from a few kernel source distributions, and running make menuconfig to configure it appropriately. Make sure you set the important options correctly (for example, you need to enable devfs) - the initial configuration does not do this.

And so on...you presumably get the point by now. Installing Gentoo is essentially a process of assembling your desired system by hand. For old-time Linux users, the experience is much like going about ten years back in time, when Linux systems really were assembled by hand. At least you don't need a big stack of diskettes anymore.

The interesting thing is that, once you're done, the result is a pretty nice system. The right packages are there, the administration tools seem to be well thought out (though things like the init script system take a little getting used to), and the "portage" package system has many of the same features that make Debian's "apt" so great. And, of course, you have a system that is set up exactly how you directed it to be and optimized for your processor.

For most users, though, the pain required to get there will probably not prove to be worth it. Your editor is not a stranger to this mode of operation, having been through experiences like converting systems from a.out to ELF by hand. But, you know, that was a while ago; now I'm more interested in having the system just work. And if I'm trying to set up a dozen (or hundreds) of boxes, the Gentoo approach is simply out of the question.

There is, of course, absolutely nothing wrong with Gentoo being what it is. There are plenty of distributions out there for people who want to be able to do an installation without thinking about it. Gentoo is aimed at a different audience - those who want to get their hands quite dirty inside their Linux systems. That is, of course, one of the great things about Linux: you can get your hands as deeply into the system as you want. As the commercial distributions get flashier and generally easier to work with, the excitement and challenge of dealing with the system at the lowest level recedes a bit. Gentoo is bringing that experience back to a new generation of Linux users and hackers, and seems to be doing a very good job of it.


(Log in to post comments)

A quick look at Gentoo Linux

Posted Mar 20, 2003 3:38 UTC (Thu) by yem (guest, #1138) [Link]

I've used LFS for over a year and just started running Gentoo on my desktops a couple of months ago. Once you've been through the install once, it doesn't take much time to configure (maybe 1 hr of actual hands-on-keyboard time). The rest of the time is automatic downloading and compilation performed by the OS.

I wouldn't recommend it for newbies or critical server use though. It is way too much for newbies and too bleeding edge for server use.

A quick look at Gentoo Linux

Posted Mar 20, 2003 7:43 UTC (Thu) by pointwood (guest, #2814) [Link]

"I wouldn't recommend it for newbies or critical server use though."

Depends ;)

I consider myself as a Linux newbie and I have successfully installed Gentoo Linux (and hosed it too :D ). I got help of course - that's what irc is for :) I want to learn Linux and I think Gentoo is a good way to do that. I don't think you really learn that much about Linux by installing the latest Red Hat distro. I had never compiled a kernel before and I don't think I would have tried it if it wasn't because Gentoo forced me to do it.

If you have a fast machine, the compilation time is not that bad IMHO and you only have to install it once.

From what I know, you should compare Gentoo with FreeBSD - it works in much the same way. I like the fact that I always got the latest release - "upgrading" is easy.

A quick look at Gentoo Linux

Posted Mar 20, 2003 13:43 UTC (Thu) by eru (subscriber, #2753) [Link]

>From what I know, you should compare Gentoo with FreeBSD - it works in much the same way.

Not unless you are talking about keeping up with FreeBSD-CURRENT. Installing
a FreeBSD RELEASE version is not any more difficult or time-consuming
than installing SlackWare or Debian.

A quick look at Gentoo Linux

Posted Mar 20, 2003 18:19 UTC (Thu) by pointwood (guest, #2814) [Link]

Okay, I didn't know that, but I wasn't specifically talking about the installation, I was more thinking about portage.

Gentoo good for learning Linux, or configuration management

Posted Mar 20, 2003 4:08 UTC (Thu) by watersb (subscriber, #10230) [Link]

Two years ago, I wanted to get involved in Linux, but it wasn't invented yet back when I was a CS major... and I had only recently encountered Linux in my workplace (move from commercial world to science research).

So I installed RedHat, and found it baffling -- what was all that stuff for? And at the time, the RPM install process was almost unusable, as RPM did not solve dependency graphs for me, and so I was always chasing package files to get something installed. Or I never got something installed...

So I worked up a system using Linux From Scratch, and while the process was, um, educational, there was no end to it; I never had a system that I could reliably use.

Gentoo fits in a great place, mostly automating the compilation process. I think that it makes a good platform for secure servers, since there is fine-grained control over what gets installed.

LiveCD Simplifies Installation

Posted Mar 20, 2003 4:12 UTC (Thu) by watersb (subscriber, #10230) [Link]

... and I forgot to mention that there are "Live CDs" available which can boot Gentoo Linux from a CD-ROM, without permanently modifying your hard disk; it includes a system similar to anaconda for auto-detecting lots of hardware.

This makes it far more simple to get a Gentoo system up and running.

Ok, I'm done. ;-)

A quick look at Gentoo Linux

Posted Mar 20, 2003 5:44 UTC (Thu) by donio (subscriber, #94) [Link]

> And if I'm trying to set up a dozen (or hundreds) of boxes, the Gentoo
> approach is simply out of the question.

Not necessarily. For large installations I wouldn't want to do manual installs for each machine but would use either a scriptable installer (like kickstart) or netbooting. Gentoo is well suited for netbooting (I have created such a setup) and a custom scripted install based on a template image is not too difficult to create either.

Gentoo Can Use Pre-Compiled Packages

Posted Mar 21, 2003 1:02 UTC (Fri) by watersb (subscriber, #10230) [Link]

If I were setting up hundreds of workstations:

1) Once I had my "golden master" machine set up, then I would duplicate the disk with dd for each machine. Think Norton Ghost. A script could set a hostname after dd was done.

2) On that "golden master" machine, I'd tell Gentoo to build binary packages (as a side effect of installing, a last step during the normal process). I would post those packages (they are automatically generated in /usr/portage/packages) to a network volume. I could re-install from this standard set with "emerge --usepkgonly <pkgname>"

This doesn't seem all that different from what our Red Hat sysadmins do.

Config files are the problem

Posted Mar 20, 2003 9:08 UTC (Thu) by hisdad (subscriber, #5375) [Link]

I'm a beginning Gentoo user and I like the promise of configurability.
This is also the problem.

After emerging these packages there is no way of setting up the services so they 'just work'. Samba installs with no smb.conf file, for example.

Worse is that the results depend on your USE flags.
I accidently emerged samba with ldap support and was completely unable
even to setup a user and password!

I had to change the flags and re-emerge it before I could get a samba
that I could use.

it needs to come with some magic webmin with a 'read my lips: make it work'
button.

Regards
Hisdad

Gentoo is ahead of the curve

Posted Mar 20, 2003 9:38 UTC (Thu) by alspnost (guest, #2763) [Link]

I've been using Red Hat for a few years, but I'm now switching to Gentoo and I'm totally converted.

Yes, you all know it's a "manual" installation job, and that you're going to be spending a lot of time compiling things, but this misses the point.

Gentoo does a lot of things differently and *better*. As the article mentioned, it takes a bit of getting used to, but their ways of managing perennial problems are elegant, well-thought out and a joy to behold. The /etc stuff, including modules, init scripts and runlevels, is very cool.

Bear in mind, also, that the source-based uber-optimisation aspect is really an aside. The fantastic portage system and dependency management would also work just fine with a binary distribution. Sure, you'd get less flexibility in terms of the binary packages having extra libraries compiled in, but you'd still get the other benefits.

Anyone out there with a powerful machine and a broadband or LAN connection should give Gentoo a try. You just might never look back ;-)

Gentoo is ahead of the curve

Posted Mar 20, 2003 20:20 UTC (Thu) by stuart (subscriber, #623) [Link]

"The fantastic portage system and dependency management would also work just fine with a binary distribution."

That's why I use Debian. I don't care about 'uber-optimisation' besides if you only use it on a powerful machine then you negate the benefit of this optimisation as well.

In short I find Gentoo great for the reason that it keeps a certain sector of the community happy...leaving me to run Debian stable...it just works (TM).

Gentoo is ahead of the curve

Posted Mar 27, 2003 8:00 UTC (Thu) by DiegoCG (subscriber, #9198) [Link]

That's what i don't like of gentoo. Compilation is *required*.

Debian for example compiles everything for i386. That REALLY SUCKS
in things like libc, X, multimedia apps...

But the good of debian is it doesn't require you to recompile.
There're tools that allow you to recompile a package with
the optimizations you want easily (see apt-build).


That's what gentoo needs. But they can't provide binary packages for
everything given that their dependencies are dynamic.


Dynamic dependencies *sounds* good, but they don't really have a lot
of sense to me. Static dependencies that install you libraries that
you're not going to use seems good to me. What if your system changes?
If you've gentoo and you change a USE flag; you'd to recompile a
lot of packages that are affected by that USE flag.

Precompiled binary packages are COOL. That's something that
gentoo must understand if they want to extend their distro.

But sure, it's much better to have everything compiled for k7
that for i686. X must fly on those systems.

Gentoo init scripts

Posted Mar 20, 2003 10:28 UTC (Thu) by shane (subscriber, #3335) [Link]

though things like the init script system take a little getting used to

I love the Gentoo init script system. It's the first real improvement in startup scripts in Unix-land since System V!

The idea is that each script in /etc/init.d/ documents the dependencies at the beginning, and the startup script figures out the proper order to run each script. Even better, if a dependency fails (e.g. DNS), then scripts that require that service won't run - no more cascading failures! Nice.

I don't know if it does it yet, but boot time could be improved by running a certain number of scripts in parallel, since dependencies are known.

This is the kind of innovation that is possible with a large number of distributions revisiting "solved" issues.

Gentoo init scripts

Posted Mar 21, 2003 2:36 UTC (Fri) by Baylink (subscriber, #755) [Link]

I'm not fond of "better F'n ideas" on the initscript front (too many packages make assumptions about the SysVil approach which will break if you don't follow it), but this seems like it might be a winner.

I'll have to look at it -- thanks for the pointer.

A quick look at Gentoo Linux

Posted Mar 20, 2003 13:07 UTC (Thu) by dkite (guest, #4577) [Link]

I built a gentoo installation while maintaining a working system, chroot'ing to build
it bit by bit from a Debian system.

One more advantage is the capability to have more than one working version of
kde. I have 2.2, 3.0, 3.1 and cvs head on my system. Have to hack a little to not
mess up configuration, but it's all there.

Gentoo is perfect for someone who wants to start contributing to a project. Quite
a few cvs ebuilds are available. Oddly it cuts away some of the learning curve on
the bleeding edge.

Derek

A quick look at Gentoo Linux

Posted Mar 20, 2003 15:30 UTC (Thu) by mbcook (subscriber, #5517) [Link]

Gentoo is what I use on my main Linux box. It's a great distro and I find it to be quite powerful and flexable. That said, when I want to set up a server on a slow box, or want to set up a bunch of computers fast, I use Debain. Gentoo is great, but when it takes my dual 600 hours upon hours to compile X or glibc, you can only imagine the waiting that would occur on a Pentium 200. And while the install is bad at first, the second time and on it's quite easy since you've done it before. It's a niche distro to be sure. As for it taking a long time to build, it shouldn't take to long if you start in stage 3 (which means many things precompiled). But that kind of defeats the purpose of the distro a little.

A quick look at Gentoo Linux

Posted Mar 20, 2003 16:51 UTC (Thu) by tomalok (guest, #7357) [Link]

another thing to note is that gentoo suports using 'distcc' (for distributing compilation across machines) and 'ccache' (c/c++ caching precompiler) to help speed up those compiles that take forever (X, mozilla, etc.)

http://distcc.samba.org
http://ccache.samba.org

A quick look at Gentoo Linux

Posted Apr 10, 2003 12:40 UTC (Thu) by iwbcman (guest, #10572) [Link]

the article posted here is relatively fair to Gentoo. albeit very short, and incomplete, the points made are accurate. mentioning gentoo without mentioning portage is a no-no- precisely because portage *is* Gentoo. Portage is far more than debians package system-for it handles all dependencies automagically and allows for mulitple concurrent versions of libraries using the SLOT mechanism. The point of configurabilty outweighs the point of optimizability, IMHO. No other distro allows you to setup your multimedia apps, from the get-go, to take advantage of the wealth of various codecs- and this is legal *because* you the end-user are doing the compiling-not gentoo.org. This applies beyond codecs, for this configrability allows you to easily configure your DVD and to take full advantage of freetype. getting mplayer/xine/totem etc. correctly configured and install on other mainstream distros remains an intractable nightmare. Gentoo is as stable as you let it be- being as it is that most gentoo users prefer the bleeding-edge they tend to run more unstable systems-but there willingness to do so helps the software development community at large immensely by exploring combinations of software and their dependent libraries which expose faults and errors in application code, helping to quickly resolve such errors. There probably is no better metadistribution for the development of new software- there is no such thing as a crippled kde or cripelled gnome with Gentoo-thus Gentoo users get the real thing. no Gentoo is not for everyone, but there are countless newbies in the Gentoo community, and although Gentoo differs greatly from redhat/suse/mandrake as regards runlevels and configuration files-anyone who can administer a Gentoo system can administer any other linux distro and *BSD with only a minor learning curve involved.

if you wish to install Gentoo on mulitple machines which have all have the same processor generation(ie. i686) one can simply use the -b option when emerging software which will create a bzipped2 archive of the compiled source which can be burnt onto a CD for distribution amongst multiple machines- it adds approximately 1 minute per compilation on average. If your machine are using differing processors (and to some extent differing architectures) you can do re-merge of the entire system for the machine at hand, compiled for the specific processor of that machine, using the build-only option in emerge on the originating machine. Such in combination with ccache and distcc make it possible to install gentoo on many machines quite quickly(with mulitple machines setup with a stage3 Gentoo system and pre-compiling your own binaries the speed is comparable to precompiled distros installs, provided that you use the -b option when doing your intial first machine install-which obviates the need to redo the entire procedure for each machine/stage3-based installs on a network of roughly equivalent machines allow for remarkable compilation speed when used in conjunction with distcc-with sufficient machines compilation time can be reduced by as much as 60%, perhpas even more, and the compiled sources only have to be compiled once)

Gentoo does not require reinstalls and does not follow the release schedules like other distros-upgrading Gentoo from one version to the next is an absolute breeze except when all the core libraries are being upgraded beyond minor version increases(as was the case between 1.2/1.3 and 1.4-which was somewhat involved-yet even such a major upgrade(gcc-2.9.5->3.2 glibc 2.2->2.3.2 etc.) is doable within an existing installation) and unlike other distros users Gentoo users get to experience incremental improvements to their software on a regular basis defined by them-ie. you can upgrade per week/month etc. this results in the constantly refreshing appeal of gentoo-living up to its reputation as bleeding-edge. of course if stability is your goal, a little research in the incredible gentoo forums will help you to decide on which version of which software works best for you- and you can then maintain it at these versions and only upgrade with minor versions only that software which you wish to change, allowing for fine-grained securtiy updates and incremental changes. the Gentoo forums provide help with this and virtually all other issues in one of the most lively, friendly and informative forums which exist in the linux world-this is utlimately what results in the most Gentoo "converts" for there is no better support period in the entire linux community.

A quick look at Gentoo Linux

Posted Sep 27, 2003 12:52 UTC (Sat) by bjornrun (guest, #15482) [Link]

I have tried Gentoo and liked it. The pluses are:
* Portage - being an OpenBSD hacker it is easy to understand. Lot of applications and they are of latest version.
* Configurable compile time optimisation and good instructions how to build complete systems using distcc and ccache.
* Easy to set up OpenMosix clusters (the reason for me choosing this dist)

The minuses which made me to switch to Debian:
* Debian packages are more tested together than Gentoo. One wrong emerge (do NOT use emerge -unmerge ...) and you are in unstable system and back to square one (yes, happens for me in Debian also but there the problem is the too much dependecy check)
* The portage system sets too many defaults you DON'T have exact configurations of packages. Here Debian is better with debconf contrary to belief.

My current server builder process uses standard Debian (use Morphix to get started when setting up a workstation) Track testing and use unstable when needed. (Debian stable is still outdated and was the reason of testing Gentoo). When the system is build, configurated and works as you want. Rebuild everything with apt-build. Same configuration, no need to answer a question every other hour. Everything is same only optimised for your processor. Succeeded in tuning without taking down the server!
I think Debian is a true superset of Gentoo. I'm not an expert of Debian nor Gentoo, I just need a quick and reliable way to get servers running and installing open source applications.

One last thing, Gentoo and Debian are similar in one aspect, because there is a short command "emerge" respectivly "apt-get" that take care of the complexities of installing applications. Neither distribution are for newbies. Lot of time are spent (for me anyway) of looking behind the scene and understanding / debugging the process.


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