Gentoo Linux

In addition to endless customization possibilities and performance improvements, Gentoo offers solid documentation and a strong community support base.

Most LJ readers are familiar with the various commercial distributions of Linux available for desktop and server systems. When one thinks of these commercial versions of Linux, one naturally might gravitate toward such names as Red Hat, SuSE or Mandrake. Some may even go so far as to think of UnitedLinux or, dare I go there, SCO Linux. Then, of course, there are your non-commercial community-supported distributions, including Debian and Slackware. When I mentioned to a friend that I was going to install Debian on a system so I could learn more about Linux, he suggested I try the Gentoo distribution.

What Is Gentoo?

According to Gentoo's architects and developers, Gentoo Linux is a ”special flavor of Linux that can be automatically optimized and customized for just about any application or need“. Depending on how deeply customized you want your system to be, this customization can be as simple as selecting only the applications and services you want on the system. On the other end of the spectrum, you could go as complex as instructing the compiler directives to utilize instruction sets that render executable code compiled specifically for your processor. The ease with which this customization occurs is part of what gives Gentoo its strength. Modify one file (/etc/make.conf) with the processor directives you wish to use, and let Gentoo's Portage system build executable files optimized for your exact needs.

Another, probably more important, hallmark of Gentoo's flexibility is you build the system according to your exact needs. You determine, at the package level, what it is you require your system to do. For example, if you were building a desktop system on which you had no desire to run a Web or mail server, you could install only those packages that you want on your system. If you want GNOME, you install GNOME. If you want KDE, you install KDE. If you want the plain Free86 windowing system with twm, you install the plain Free86 windowing system with twm. What makes Gentoo perhaps the best distribution with which to do this sort of customized system building is the underlying package management system that is this distribution's foundation: Portage.

According to Gentoo's home page, Portage "is the heart of Gentoo Linux, and performs many key functions". Portage acts as the software distribution system; it also acts as an integrated package-building and installation system, as well as a system updater. In these ways, it is similar to Red Hat's RPM and Debian's apt-get functions, but it is more powerful than either. This power manifests itself in the use of the Portage tree, which is a set of scripts downloaded to the machine that control the dependency needs and compilation options of various source-based software packages (over 4,000 at last count).

My Experience Installing

Installing Gentoo Linux is a more manual affair than is installing the commercial distributions; however, there is talk in the Gentoo forums of building a graphical installation that will automate many of the tasks. Presently, in order to install the Gentoo distribution, you make your decision about how much customization you wish to introduce to your system, and then you download the appropriate ISO image from the Gentoo Web site or purchase CDs from the Gentoo store.

You can choose to optimize your system fully based on compiler directives and built-in dependencies, which includes setting the optimizations and then building the compilers used to compile the rest of the software. Alternatively, you can choose to use pre-built software from the Gentoo group. The advantage to optimizing the compiled code with your own settings is the code generally runs faster on your system if you optimize it for your processor's specific instruction set. The disadvantage of this option is the time spent on the compilation process, which can be quite extensive, even given the advances in modern chip architecture. For my installation, I chose to go with the Stage 1 tarball installation. This means I was building my system from the ground up, compiling the compilers that would be used to compile the rest of the software that would be installed on my machine.

Essentially, the installation is as straightforward and as similar in fashion as almost every other operating system installation out there. The only difference is the manual nature of the individual steps, which are well documented by the Gentoo staff on the Web site. I started out by downloading the Live CD ISO image that I wanted to use and then burned it to CD. Using the Live CD, I booted my destination machine into a self-contained Gentoo environment included on the CD image. I enabled DMA on my hard drive and allowed the network to be configured by DHCP. Following this, I used fdisk to partition my drive. I created my filesystems and formatted them; I chose ext3 for my boot partition and used ReiserFS for my root and home partitions. After disk setup, the fun really starts.

The next step was to extract the Stage 1 Tarball I chose to start with. Afterward, I wanted to make certain I was using the latest Portage tree, so I performed an emerge sync. Then, to make sure I was compiling my software with the appropriate compiler directives, I used nano to edit a single file, /etc/make.conf. After ensuring I had all the customizations I wanted in the configuration file, I started the bootstrap process, whereby Gentoo's scripts recompiled the GCC compiler. Following this step, I moved on to Stage 2, which essentially comprises more compilation of basic system components. This occurs automatically with the use of the Portage system and the command emerge system.

After the several hours that the compilation took, I had to modify the /etc/fstab manually to indicate where my partitions were. I also had to download the source for my kernel and compile it. After this, I downloaded and compiled a system logger, a cron dæmon, set my root password and configured a boot loader. I then cleaned up by unmounting the various file systems I had mounted for the installation process, ejected the CD and restarted my machine. At this point, my machine was a clean shell, awaiting my command to install software using the Portage system. When all was said and done, it took me approximately 24 hours from start to finish to have a fully functional, fully customized desktop system.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Gentoo and I Just Broke Up

Dohn Joe's picture

Gentoo/Sorcerer/Debian

Anonymous's picture

Hi,

I'm currently weighing up which Linux distro I'm going to go with. I've been using Linux for a number of years, starting with Redhat and moving to Debian. I'm currently using Mandrake 10.1 but not really liking it. I am trying to decide if I should go back to Debian or give Gentoo or Sorcerer a try. I'm on unlimited dialup, so I'd like to be able to do updates overnight. Please help me choose!!

Rob

On the other hand...

CyberGlitch's picture

Gentoo involves a LOT of downloading, in other words: dialup and Gentoo are a bad mix. Unless you are incredibly patient, a different distro would probably be a better choice, but hey! If you are up to the challenge, go for it!

RE: Gentoo/Sorcerer/Debian

q-parser's picture

I'd suggest you using Gentoo. This widely spreading distro has much to offer to its users. Having read the article above might have given you some idea what's all about. If you choose for Gentoo, you'll get fully customizable system with loads of features. What I consider to be the greatest advantage ot it is that going through all the installing process give you insight of what is actually going on in linux and how it works. So in short, go for Gentoo!

q-parser, Slovakia

Re: Gentoo Linux

Anonymous's picture

I've used Sorcerer Linux since more than a year. And I installed Gentoo on my machine (on another partition) and get realized about some advantages when using Sorcerer rather than Gentoo:
1. In Sorcerer when you update a package (called a Spell in Sorcerer), you don't have to download the whole source of the package; but you can download (leech) the xdelta file which is like a patch that's applied on a compressed file.
So imagine that in Sorcerer you can download about 4 MB to update Linux kernel, but in Gentoo it's not the case since you need to download the kernel source.
2. Sorcerer has heal command which checks for any corrupted installed package and fixes it when you have enabled Spells Archive, or just recompile it and install it (recast). And that's not the case in Gentoo, since you don't have heal-like command.

I admit that Gentoo site is more organized than Sorcerer's, but the distro Gentoo is less robust than Sorcerer.

Sorcer Linux "Heal" Command

MetaPhaze's picture

I suggest you do a little more research before posting...

Gentoo Linux has a "heal-like" command... *laughs uncontrollably* but I still can't believe people would use an operating system that treated them like a bunch of monkeys playing video games... *laughs again*

Gentoo Linux comes complete with the Portage Package Distribution system and the Gentoo Tool Kit (gentoolkit).

Once you install gentoolkit, which takes less than 10 seconds usually... you have a command called revdep-rebuild... which will scan your system for broken packages at any time and re-compile and install them for you... it will even go as far as letting you reinstall packages that use a specific library.

Sorcerer *laughs* sounds like a kids toy i'd buy my 10 year olds.

Sorcer Linux "Heal" Command

Anonymous's picture

MetaPhaze, you do realize that you are replying to a post that is 5 years old (at the time you replied), 6 years old at time of my reply. What is now available in Gentoo was not always there. Maybe Gentoo borrowed the idea from Sorcerer ;-)

Re: Gentoo Linux

Anonymous's picture

1. This requires you have the older package available and that it is sane. It is safer to download the new paqckage and an MD5 checksum instead. Gentoo does use patches where applicable, E.G. for patched kernel sources.

2. If a package successfully compiles it will generally work. For installed packages there are tools to solve many traditional problems such as missing libraries etc.; the equivilent of recasting a spell would be simply remerging an ebuild and there are similar heal commands to find damaged packages.

Portage is undoubtably one of Gentoo's strongest points and the reason I, and many others, find using it a pleasure...

euphor][a

Re: Gentoo Linux

Anonymous's picture

I am not sure what sorts of problems "heal" fixes but maybe revdb-rebuild (part of gentoolkit) is similar?

revdep-rebuild looks for binaries with broken .so dependencies and rebuilds the packages that own such binaries.

Re: Gentoo Linux

Anonymous's picture

You are wrong you can give portgae the command --buildpkg and it will build a .tgz with the compiled program for you to reinstall using the -K option ;)

Re: Gentoo Linux

Anonymous's picture

what I'm talking about was a command called heal, which checks for any errors in the system and fixes it.
BTW, Sorcerer Linux is built for sysadmins -while it's easy to install/use by a newbie-, but imagine that every sysadmin needs to follow every package he installed and see wether it's corrupted or not -which is the case in Gentoo since you need to do that manually-. This is not the case in Sorcerer since you have an option to run that heal command manually or automatically after you install any related package.

Sorcer Linux "Heal" Command

MetaPhaze's picture

heh, revdep-rebuild does the same thing as "heal"
the exact same thing... Gentoo is easy to install by a newbie... people just think too hard and make things more complicated than they really are... if you follow the instructions on the Gentoo site, you have no excuse as to why you couldn't install it... other than not knowing what hardware you have... which can usually be solved by using genkernel... which will build you a kernel that will work for your system automatically...

Real admins don't work that

Anonymous's picture

Real admins don't work that hard. That's what newbie admins who haven't figured out how things work do it. Real admins let the machines do as much of the work as possible because they understand: that's what they're for.

Re: Gentoo Linux

Anonymous's picture

Gentoo performs MD5 checksums when you download a package. That alone will cut out 99% of corrupt packages (to be honest, I have yet to have a package come down from a server corrupt, so I don't know how it handles it.)

Past that, it also performs a checksum check when you install the program (so if you download the package onto one machine for later use on that, or any other, machine, you have a check there as well).

So you do not need to manually check packages for corruption -- it would be such a rare event that you could relegate it to special handling.

That being said, I do agree that heal is a nice idea nonetheless :-).

Re: Gentoo Linux

Anonymous's picture

It seems that people are missing the initial poster's [hidden] point about heal, which is to fix packages that have already been installed and have gone bad some time *after* installation. It's not a common occurrance, but when it happens, it's a b***h to find and fix without automated tools.

Sorcer Linux "Heal" Command

MetaPhaze (anonymous)'s picture

with revdep-rebuild.. it is not hard to find and fix... at all... you are missing the point for sure...
revdep-rebuild is just like heal.. it does the same thing.

Re: Gentoo Linux

Anonymous's picture

Using qpkg from gentoolkit u can perform a check on the status of an installed package. Each file in a package has its md5 sums and mtimes recorded, and those can be checked with 'qpkg -c '. A list of packages to loop over can be achieved with 'qpkg -nc -I', so in short:
for x in `qpkg -nc -I`; do qpkg -nc -c $x; done
, will do the trick of identifying which packages has got some files that have been tampered with... this only holds if the package db isnt corrupted as well...

I don't know if this is what was asked for?

Re: Gentoo Linux

Anonymous's picture

"Generally speaking, the users I have encountered have been warm to newcomers, and they appear to be interested in cultivating a large base of users for this product. It's rare in the technical community to find seasoned users who are as adept at answering the questions of newcomers such as myself as they are at helping other seasoned users solve technical problems."That's a big point as to why I enjoy Gentoo so much, but I don't think we're cutivating a large base of users, we're just enjoying it so much, that we're happy to help others as they've helped us. I've used 5 distros, each for more than 6 months each, and I've never had such a positive experience with support in the forums/irc/mailing lists. As far as the optimizing thing, I'm sure it's not a huge difference, but who cares, it's a little more customized, but you have full control, which forces you to learn more. Lastly, I *LOVE* how I don't have to reinstall every 6 months when a new distro version comes out, I was really getting sick of that. Now it's a command like: emerge -uD world to bring myself up to the current stable (or unstable if I choose) version of Gentoo. It's all that I've ever wanted.P

Re: Gentoo Linux

Anonymous's picture

Gentoo isn't the only distro you don't have to reinstall. Debian has apt-get update ; apt-get dist-upgrade and then you get everything that's new since last time. I haven't reinstalled for years.

Re: Gentoo Linux

Anonymous's picture

You post seems to imply some familiarity with Gentoo. So a question: I am stuck behind a dial-up modem. Can I realistically hope to do emerge processes overnight on a regulary basis? Are these done as patches? Or do source packages always come in an entire ball?

Thanks

Re: Gentoo Linux

Anonymous's picture

I'm not the parent to your post but I do use Gentoo. There are people who use Gentoo with no problems on a dial-up connection, I'm not one of them though. What seems a popular solution is to use the -f switch when upgrading to download the sources first. That way you can disconnect and later perform the actual upgrade using the downloaded source packages. Unfortunately Gentoo currently downloads the entire tarball for each package instead of just a patch from a previously install version. This has it's good and bad points though, but you will often have to download some pretty large source tarballs which maybe a burden for a user on dialup.

I've run gentoo for a few yea

FireCat's picture

I've run gentoo for a few years now, and have found that even on broadband it's a good idea to use the -f switch and download the sources first. The reason is that any broadband glitches won't affect your upgrade once they are downloaded. Even though these disruptions are minimal, it can prevent a few choice words when the car hits the telephone pole on the corner.

Re: Gentoo Linux

Anonymous's picture

After 2 years using Mandrake (a good distribution), I decided to try Gentoo. It took me a while to get some things working (like direct rendering on my video card), BUT I am EXTREMELY happy with the results. Not only do I have a system optimized for my hardware, but I know exactly what is on it and why it's there. With RH, SuSe, Mandrake, all kinds of stuff gets installed by default (yes, I know you could deselect all packages and then create a custom list of your own). I like the idea of start with a blank but optimized slate and adding just what you want.

Gentoo rocks! And the Gentoo forums can't be beat.

Re: emerge -u

Anonymous's picture

> in order to update it and my entire system,
>I merely typed emerge -u world. All the packages
> I had installed on my system that had updates available
>then were updated.

It is important to note that emerge -u only searches for updates on packages you've specified on the command line - ie, if you emerge kde, and it pulls in mplayer as a dependency, "emerge -u" won't find updates for mplayer. you need "emerge -uD" ( or --update --deep ), which checks all packages.

is there any good reviews of

Buzz Lightyear's picture

is there any good reviews of linux os anywhere?

Re: emerge -u

Anonymous's picture

[ emerge -u world ] updates every package you have installed on your system that needs an update remember to emerge sync before so it can get all the latest updates.
gentoo has 2 ways to install the standard and the ARCH="" way which installs unstables / stuff that just came out... 2.6.1 came out 2 hours ago and theres allready an ebuild :)

Re: Gentoo Linux - Thinks it's good? Try Source Mage !

Anonymous's picture

Source Mage is *FAR* easier to install & use. with the same benefits.

Gentoo developers seem to always choose the hard way to do things in the install process.

Re: Gentoo Linux - Thinks it's good? Try Source Mage !

Anonymous's picture

The install isn't hard in any way, it's just timeconsuming, and i really really doubt you get a fully optimized system with Source Mage, to get that, you need all that compilation time that gentoo consumes :p.

Re: Gentoo Linux - Thinks it's good? Try Source Mage !

Anonymous's picture

Did you try Sorcerer Linux?

Re: Gentoo Linux - Thinks it's good? Try Source Mage !

Anonymous's picture

Does it allow me to pin an older version if I want?
Essential in server machines.

How many packages does it provide?
If the info I gathered from the site is even nearly correct then Gentoo has about three times the amount of packages than Sorcerer.

Does they have Bugzilla set up?
I didn't see that, but I only looked the site fast. (It's a mess)

Gentoos strength is it's community and the users.

Anonymous's picture

Thats the truth, with gentoo they have a strong community, forums, documentation and thier chief architect actually understands the open source model. Unlike (ahem) a few other distros. (redhat)

Personally I am a network administrator and I used to have to go out and download and compile and install all kinds of nice open-source programs on redhat-like distros. With gentoo I have not found any that werent in portage, although i might in the future.

Re: Gentoo Linux - Thinks it's good? Try Source Mage !

Anonymous's picture

I went to the source mage website and it pretty much sucks when compared to gentoo's. I found dead links and I could not find any install docs to read ahead of time.
I think the whole Gentoo community is part of the popularity and the distro itself is getting better and better all the time.
There is no reason for me to even try source mage.
The Gentoo install is not that difficult, I had a newbie at work do it and he got it right the first time.

Re: Gentoo Linux - Thinks it's good? Try Source Mage !

Anonymous's picture

Although I'm not going to claim that sourcemage.org has a great web site, the dead links were caused by a problem with ibiblio, not sourcemage. The problem appears to be fixed, and I have no problem accessing the web site.

I've used gentoo extensively, and am currently using sourcemage. I've also used freebsd a lot. I find sourcemage to be comparable in quality to gentoo, and much easier to install.

In other words, if you're already using gentoo, there's not much reason to switch; but if you haven't installed gentoo or sourcemage, and especially if you're put off by gentoo's tedious installation process, sourcemage is a good choice.

Adam

Not that tedious

Anonymous's picture

What is tedious about it ? It takes me about 10 minutes to make a bash script for the install then after that is done I come back and compile the kernel, install grub and edit a few config files.

Well, Gentoo's install

Anonymous's picture

Well, Gentoo's install process _is_ very tedious, and infact somewhat irrelevant since such things (as you said) can be put into a script. There is no good reason for the long hauled install process, the excuse that it helps people learn more about linux is quite false, and the fact the rebuild is done at the same time is also irrelevant as it can be done after the first booting into the new system...
bottom line; Gentoo sucks, long live Source Mage! ;)

It's not that tedious

Anonymous's picture

I never found the process tedious (but then I always use Links to browse the web whilst waiting for a build to finish), it's basically just a list of "type this, and then this and then this, then configure that file, then type that...", the install could definitely be wrapped in a bash script, but it isn't exactly difficult. Also, I did find having to work with the command prompt the whole time very helpful, as someone who came from DOS and Windows without prior UNIX experience (with the exception of a brief use of Mandrake which I didn't like and was slow) I had never realised just how powerful a command line could be compared to the crap that is a DOS box [I didn't learn this with Mandrake because it booted into an overbranded GUI immediately and I would have likely avoided terminals like the plague].

Re: Gentoo Linux - Thinks it's good? Try Source Mage !

Stalione's picture

I suggest the following sequence for updating :
emerge sync
I like to see what the updates are and what USE flags are being used:


emerge -pvD world
emerge -uD world

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix