[LinuxFocus-icon]
LinuxFocus article number 336
http://linuxfocus.org

[Photo of the Author]
by Guido Socher (homepage)

About the author:

Guido really likes gentoo because it gives him more control over the installation process. More control than any other distribution.

Gentoo linux

gentoo

Abstract:

Gentoo Linux is a source package based Linux system. It is very different from the established commercial Linux distributions.

_________________ _________________ _________________

 

Introduction

Commercial linux distributions offer today an installation which is almost automatic. You answer a few question, partition your drive and after that automatic hardware detection takes over. A few minutes later everything is installed and you just login.

Many people seem to like this way of installation because it is very easy and you don't have to know anything about your hardware.

There is however one problem: You have no clue how it works. Should later on a configuration problem arise then you have no idea where a given setting comes from, which file to change, or which configuration tool to start to fix the problem.  

Gentoo is different

Gentoo is very different from the well known commercial distributions. Almost nothing is automatic. Most configuration is done on a file level manually with an editor and the installation will generally take a lot longer.

View the Gentoo installation as course on Linux. You learn a lot about the system as you do the installation. Many steps are manually and take more time but afterwards you do understand how your Linux system works.

Gentoo makes also use of specific compiler flags which optimizes the code for the specific CPU you have. In additon to that you have also the possiblity to compile with or without optional features. The end result is a very well customized system optimized for your needs.
gentoo screen shoot
The installation of gentoo is command line based
 

Package management

Gentoo is source based. In other words: by default you install packages from source using an automatic build system called emerge/ebuild. Emerge uses build instructions from a directory tree called /usr/portage Under /usr/portage you find subdirectories with build scripts for emerge. The directory /usr/portage/app-editors/ contains e.g. build scripts to build all kind of editors. Under /usr/portage/packages you can have pre-build binary packages. Those can be used to speed up the installation process. Under /usr/portage/distfiles you can copy the raw source code tar files as they are distributed by different by the developer. If a file is already found there then emerge will not need to download the files over the network.

A very important customisation option are the "USE flags" in the /etc/make.conf file. Many applications offer compile time option for their dependencies (e.g with or without mysql support or with plain Athena widget instead of Qt or with oss support instead of alsa ...). By setting the right use flags you can tune your installation.

Here is an example on how to use emerge. To install the vim editor you just run:
emerge -k app-editors/vim
or just
emerge -k vim

The -k means use binary package if available otherwise it will download the source, compile it and install it. You can check before the installation with the option "-p" to see what the system would do if you would run "emerge -k vim":
emerge -k -p vim
This would tell you what other dependent packages it would need to install and what it would do if you would emerge without "-p" (p like pretend).

Users coming from redhat will welcome "epm". This is basically a "rpm" command for gentoo. To ask e.g to which package does this file belong you use:
epm -qil -f /the/file

The syntax is identical to redhat rpm as you can see.

A second option to print package information is the qpkg command. qpkg is also a very powerful interface but the systax is of course different from "rpm". To print e.g a list of all installed packages you run:
qpkg -I -nc
 

Installation

Gentoo needs a good network connection (DSL type of connection or better). It is theoretically possible to work only with CDs but in my opinion that is not realistic. There will be always packages that you want to have which are not on the CDs. Gentoo has a very rich set of "packages" (or build instructions to be more correct).

I would recommend everybody who wants to try gentoo for the first time to use a CD and start from "stage3". The "stage3" tar packages are big pre-compiled packages. Using those package speeds up installation a lot.

Apart from this recommendation I don't want to go into details here because the installation instructions from gentoo cover everything. There is a very detailed user guide (pdf, 1102643 bytes) and a quick guide (pdf, 17899 bytes) . Read the user guide in advance and print the quick guide on paper so you have it at hand during the installation.

You may also want to look at the instruction from gentoo 1.4 (pdf, 92926 bytes). The instructions are mostly still valid for gentoo 2004.0 but they somewhere in-between the 117 pages installation instructions and the quick guide.

A big advantage of Gentoo is that you can interrupt the installation at any time. If you get stuck you can just unmount the partitions and investigate the problem, using google or read through the documentation. When you want to continue then you just mount the partitions again and continue where you stopped last time.

For the CDs I recommend to download the ISO images for CDs 1 and 2 but only burn CD1. CD1 is the main installation CD and works also as an excellent rescue CD with a lot of tools on it.
CD2 contains only pre-compiled packages and you will never need it again unless you know that you will do a number of Gentoo installation. Instead of burning CD2 you can mount the ISO file via loopback under /usr/portage/packages:
mkdir /usr/portage/packages
mount -o loop -t iso9660 packages-pentium3-2004.0.iso /usr/portage/packages
# note: change the name of iso image to the right one for your cpu type
 

It's done

The main installation will end on the command line. That is you will still need to manually install X11, KDE, xfce, ... or what ever window system you want.

You will manually edit the XF86Config file and then start X11 with startx. Once that works you edit the configuration files for gdm or kdm to have a graphical login window.

Ending the installation with only a command line may be a shock for some users but again it gives you more control as you can add exactly the packages you want via emerge.  

Conclusion

The target audience for Gentoo is the experienced UNIX/Linux user.

You need a good network connection, e.g DSL, to efficiently use Gentoo. Several sites are offering the Gentoo installation CDs but you may as well download the iso image when you have anyhow a DSL connection.

One thing that would be nice to have is a few DVDs with snapshots of all gentoo distfiles and a corresponding portage tree. Such a DVD set would allow us to install without a network connection and would make it possible to maintain an older installation over many years. If you ever find somebody offering that then let me know. I would buy it.

The procedure to install Gentoo involves many steps and takes time but the customization and optimization does make a difference. The speed gain is maybe 3-5% but the USE flags are important. You can really feel that it is your installation and not the idea of some product manager. Especially on a desktop machine it is nice to feel that it is your system with all software configured the way you need it.

I was shocked when I saw Gentoo for the first time but having used it now for more than 6 month I don't want to use any other distribution anymore. I really like Gentoo.  

Links




Webpages maintained by the LinuxFocus Editor team
© Guido Socher
"some rights reserved" see linuxfocus.org/license/
http://www.LinuxFocus.org
Translation information:
en --> -- : Guido Socher (homepage)

2005-01-14, generated by lfparser_pdf version 2.51