Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Linux Software

A Walk Through the Gentoo Linux Install Process 352

Anonymous American (Sherman Boyd) writes: "I was looking for a flexible, powerful distribution that makes it easy to build a 'custom' Linux box that meets my exacting specifications. I think I found it. Gentoo Linux has just released version 1.0 of their innovative meta-distribution and to celebrate I decided to throw it on my laptop and write this article based on my experiences." And good news for anyone interested in trying Gentoo: yesterday, Daniel Robbins announced the release of version 1.1a. Read on for AA's detailed look at putting Gentoo on his machine -- Gentoo has a different style than today's typical distributions, and it bears some explanation.

Gentoo solved many problems for me. Some distros install everything, whether you really need it or not. Not Gentoo; other than the base packages required for Linux to run, the only software installed on the system is the software you put there. Gentoo resolves dependencies automatically, eliminating RPM prerequisite hell. As an added bonus I got something I wasn't even expecting. Speed. Blinding, blazing, incredible speed.

The main advantage to the Gentoo distribution is Portage, a python-based ports system similar to BSD ports. For those of you unfamiliar with BSD ports, Portage is a package management tool that downloads and installs source instead of precompiled packages. When I need a program I download, install and compile it with one command:

emerge nmap

The above will download the nmap source code, compile and install it. Of course this method is slow, but it has its rewards. You can also opt to use prebuilt binaries if you are not extremely patient. It took me five hours to get the base Gentoo installed on my PIII with 128 megs of ram. It wasn't a big deal as I had other things to do, but I would like to see the installation process optimized so that it doesn't require any babysitting.

Gentoo is running two of my mission-critical servers right now, I consider it to be stable and mature. A warning, though: this is not a distribution for dummies. This is bare metal Linux, powerful and dangerous. If you do something without thinking you may fall into a bucket of pain.

Let's begin my story.

I download the iso from http://www.ibiblio.org/gentoo/releases/build /. There is a choice of install images here. My favorite way of installing Gentoo is to compile everything, a time consuming process. This method requires a slim 16-meg iso. You may want to grab an iso with pre-built binaries to speed things up, however. This fat iso weighs in at 103 meg. I download the big one with the prebuilt binaries even though I won't use them -- just in case.

I boot my laptop with my shiny new Gentoo CD. The Gentoo install uses isolinux by Peter Anvin. I like the fact that they don't obscure it, giving credit where it is due. It boots quickly and there is a PCI autodetection process, it shouldn't find much on my laptop. Interesting, it loads a SCSI module. Perhaps it has detected my IDE CD burner. Usually this will detect any PCI NIC cards that are installed, but it does not detect my PCMCIA device (of course). After the PCI detection I get a command prompt. I use nano (a small text editor) to open up install.txt, the excellent install doc. Usually these docs are sufficient but the latest ones can be found here:

http://www.gentoo.org/doc/build.html

Keeping the install doc open in this virtual terminal, I hit alt-f2 to open a new one. I begin by loading the pcmcia drivers and installing networking. This is all done at the command line ( insmod, ifconfig, route, dhcpcd, etc.). I use nano to add my DNS servers to /etc/resolv.conf. A word of caution; get in the habit of always using the -w switch with nano. If you do not use the -w switch nano's word wrap feature will jack up your config files. I ping a reliable site, networking is up!

Next I partition my system using fdisk. I choose a simple layout with a swap partition, a root partition and a small boot partition. The boot partition remains unmounted during use, a nice precaution. For filesystems you have a choice of ext2, ext3, ReiserFS and XFS. In my personal experience I've noticed that Reiser performance really rocks when combined with SCSI drives, but as this is an IDE system I think I'll go with XFS. Besides, the XFS tools seem to be a lot more mature than the offerings from Reiser. I format and mount the partitions from the command line creating a /mnt/gentoo directory. I then untar the root filesystem; here I have the choice of the small tarball that requires you to compile everything or a larger tarball that contains pre-built binaries. If you untar the big guy you are almost finished with your install at this point. Using chroot and some scripts you chroot the /mnt/gentoo directory. From this point on you are operating under your new gentoo system.

The first thing I do under my chrooted system is issue this command:

emerge rsync

This downloads the latest version of the portage tree. The portage tree is found under /usr/portage and contains the ebuild scripts used to compile/install programs. Currently there are over 1000 up to date emerge sripts. Next I edit /etc/make.conf, here I can choose compiler settings. I optimize everything for i686. Now it's time to build the GNU compiler and libraries. I run the bootstrap script and leave for lunch. On my PIII 500 the boostrap process takes 2 hours and 2 minutes.

The second emerge command I issue is:

emerge system

Now emerge downloads, compiles and installs my base system packages. I sit back, relax and take the time to fax my legislators a rant about the DMCA. One hour and 30 minutes later it is finished.

Now it is time to download and install the kernel. First I make a link updating my timezone, and then I issue another emerge command:

emerge linux-sources

This grabs the latest kernel, 2.4.19, and drops the source in /usr/src/linux. Ten minutes have elapsed. Now comes the fun, compiling your kernel. That's right, everyone who installs Gentoo compiles their own kernel as a matter of process. I like this. There are some distributions out there that actually say you should never compile your own kernel. Shame on them. I use make menuconfig and the standard commands to compile my kernel. Since Gentoo uses devfs I select /dev file system support and I am also careful to compile in support for XFS. I don't have the kernel mount devfs automatically at boot as the Gentoo startup scripts take care of this for me. Virtual Memory file system support is also enabled.

At this point in time I get to choose a logger. My choices are sysklogd, syslog-ng or metalog. I choose metalog, because it's got the coolest name. I download, compile and install it using a single command:

emerge metalog

XFS has some nice utilities, I better install those. I have some other essential programs to install, and I'm feeling a bit lazy so I chain them all in one big command.

emerge xfsprogs;emerge bitchx;emerge vim;emerge links

At this point I'm feeling pretty 7-Up. I edit my /etc/fstab file, my /etc/hostname file and /etc/hosts. The passwd command is run to set the root passwd. I add my NIC module to the file /etc/modules.autoload and edit /etc/conf.d/net. conf.d/net allows me to configure my IP address and settings, default gateway and alias. I take a look at /etc/init.d/net.eth0, even though I don't need to edit it. I can then add it to the startup script using this command:

rc-update add net.eth0 default

This adds the script to the default runlevel to be executed at startup. Startup scripts are another place Gentoo really shines. The startup scripts have a system of dependencies. For example net.eth0 can depend on pcmcia. The pcmcia drivers get loaded before net.eth0 - this is good.

Next I install grub. If you haven't used grub before, it's nice. You can boot to a kernel directly from the grub shell, without having to edit a config file. lilo is still available, for those of you who prefer it. Gentoo likes to let you make the decisions.

I exit my chrooted shell and unmount all directories. Reboot! Gentoo comes up and the install process is complete.

The Gentoo install process has taught me a lot about Linux, and I like the fact that the command line is embraced, instead of hidden behind gui or scripts. I also like the speed (which is debatable since all I can supply is anecdotal evidence). I wasn't too happy about waiting five hours for everything to compile, but I think it was worth it. I can tell you it compiles and greps noticeably faster than other distros I have run on the exact same machines. I really enjoy using portage, and the packages seem to stay up to date -- if not bleeding edge. This is not a conservative distribution like Debian, however I like the aggressive and intelligent direction gentoo is taking.

If you are considering trying out Gentoo I highly suggest #gentoo on irc.openprojects.net. Also subscribe to the mailing lists found at www.gentoo.org. The Gentoo community has helped me out of several jams in the past, I think they will treat you good too.

While writing this, I received help from a lot of people. However I would like to personally thank the people I ripped off word for word. Thanks notafurry of www.kuro5hin.org for your pointed help with the stilted second paragraph and thank you Ween from #gentoo on openprojects.net for your clean description of portage.

This discussion has been archived. No new comments can be posted.

A Walk Through the Gentoo Linux Install Process

Comments Filter:
  • by Rorschach1 ( 174480 ) on Tuesday April 09, 2002 @02:13PM (#3311030) Homepage
    The Gentoo site looks about like that of every other distro out there... just fine if you know exactly what you're looking for. How about grabbing a few average Linux users and watching them try to find what they need? I think people just don't realize how poor a lot of the websites and documentation are.

    I think Debian, for example, is a fine installation. I've used it frequently. But the website really irritated me when I needed to find some specific floppy images and hardware support the other day. I got so frustrated that I finally gave up and went to FreeBSD. It's far from perfect, but I found what I was looking for in short order and quickly had the machine up and running.

    Here's a question for anyone involved in the production of ANY distro out there: Is there ANY form of usability testing that goes into these sites? What's the process these people are using for designing the sites?
  • by Rorschach1 ( 174480 ) on Tuesday April 09, 2002 @02:30PM (#3311163) Homepage
    I think that attitude is the core of the problem. There IS such a thing as usable, and some designs are just plain BAD. My sister's finishing up a Master's at Stanford in the field, and she's shown me that there's a hell of a lot more to it than I would have thought.

    I run a busy (military) website myself, and I've found that a lot of the users on the site don't use the site in the same way I would. They get the information they need, and they put up with a sub-optimal interface, but if I can find out what they're trying to do it's often a matter of a simple change to allow them to do it with a lot more efficiency. You can't ever ignore the users and tell them to "get used to it", just like saying "read the source code" doesn't cut it as documentation for most folks.

  • Yeah, right. (Score:4, Insightful)

    by josh crawley ( 537561 ) on Tuesday April 09, 2002 @02:43PM (#3311279)
    This distribution SOUNDS nice, but plain sucks in practice. First, to remove the suckage, have a cd full of source tars. No need for the net.

    That in itself is the main gripe. Bandwidth is the biggest problem. I can bring my computer to my college to download an image (or few). It's big, but once a few months isn't bad. However, all I've got is a modem connection at home (and I'm sure gentoo's program doesnt support resuming). What?! KDE desnt come with it? Guess I'll have to download it. (a day and a half later)... Still isn't done! DAMN! Heh, and then comes compile-time.

    Face it, this distribution is for high bandwidth connections, not for us modem users. And what's really funny is that just yesterday, Slashdot posts article: "Time Warner to Charge Extra for Over-Quota Bandwidth". Yeah, these go together real well.... Reeeeal well.
  • Re:rock (Score:1, Insightful)

    by Anonymous Coward on Tuesday April 09, 2002 @02:49PM (#3311310)
    Well its been around since 1998 and has done basically the same thing as gentoo since then. What gentoo is doing is old hat. Rock Linux 2.0 which will be out later this year will be much more than a distro.

    I dont think slashdot likes them or something as most of their news never shows up here. Only lwn, linuxtoday, linuxjournal, etc. So slashdot readers might not know about them.
  • Re:rock (Score:1, Insightful)

    by Anonymous Coward on Tuesday April 09, 2002 @02:51PM (#3311321)
    I've been using ROCK since it's 1.2.0 release, and
    I have to say that I really love it. Since you
    can completely build the whole distro on your own,
    it allows a high level of code optimization to best
    fit your hardware.
    ROCK isn't a distro for the beginner but for
    advanced users which don't want to use yast, linux-
    conf, ..
    ROCK currently still doesn't have a very good package
    management system, but developers are currently re-
    solving this issue in the 1.7 development tree.
  • by lotaris ( 34307 ) on Tuesday April 09, 2002 @02:53PM (#3311343)
    It's like freebsd in that you set all your config options in central files (for gentoo /etc/make.conf). In gentoo this include things like c and c++ compile options as well as any specific packages you know you are going to use (kde, gdk, qt, gnome, esd, ...).

    That way when you build packages you get the compiler options and ./configure options appropriate for the box you want, automagically.

    You can also use env variables to override of course.
  • by Speare ( 84249 ) on Tuesday April 09, 2002 @03:26PM (#3311563) Homepage Journal

    The leadin says that Gentoo eliminates all that RPM dependency hell. I agree, that's how most newcomers to the RPM scheme see it. A lack of higher tools and a lack of understanding has left many a new RPM user crying in frustration.

    I haven't used Gentoo yet, and it may be the greatest thing since sliced bread. In the interests of helping newcomers who try RPM-based distros, however, a couple of points...

    RPM is a package format, and rpm is the low-level tool that deals with those files. If you use rpm directly, you'll have to deal with the deluge of interconnecting dependencies yourself. However, it was not designed to be the sole front-line tool, it's the workhorse.

    Unlike the Debian strains which all adopted the apt-get tool, each RPM-based distro has gone their own way with dependency management. Debian doesn't seem to focus so much on a distinction between dependency management and package management.

    This dependency management is typically the commercialized aspect of the commercialized distro market: pay a value-added subscription fee for the ease of using a simplified network based package update/installer as a service, as well as some preferential bandwidth considerations. Faster downloads, push-down email notices, scheduled automatic installations, and other value-added services are attractive to corporate and casual users.

    Service tools like up2date, redcarpet, and the like are the intended front-ends that use the rpm mechanisms to seek, download, validate, and install packages.

    Much of the problem with package systems, rpm or deb, lies in the unorganized and untested packages produced haphazardly by small project folks, and the ad-hoc installations by casual users. The end users try rpm directly, or the weak gui equivalents, and at the first sign of dependency problems, they start using --nodeps or --force. Paraphrasing Asimov, "--force is the last refuge of the incompetent." The surest way to bollox an RPM machine is to --force a few packages or remove them with --nodeps, leaving a patchwork of unsatisfied dependencies. The surest way for a package maintainer to encourage such destruction is to blindly make packages that depend on too much, or too little.

    Package management needs to grow up, and recognize the experimenter's needs: add tools at whim, try it a while, and remove it.

    One: If you're not an expert, and want to play with a package for a bit, see if one is produced by your distribution first. Failing that, then see if someone's made a package intended for your version of your distribution. Unless you're going to spend the time reading the source code, it's usually a waste of time and energy to rebuild a package, and it'll be less compatible with your distro anyway.

    Two: If you manage a package, and your program can use X or libaudio or whatever but doesn't absolutely require it, then consider making two packages or making your program smart enough to use what's present at runtime, rather than blindly depend on it being present at installation time.

    Three: The key to user-interface design is that the interface needs to understand the user. Not the other way around. Focus on the needs of the expected types of user: neophyte through master. If you're new, --help and RTFM aren't enough. Don't just teach the user to fulfill the tool's needs, teach your tool to anticipate the user's goals. Don't just teach people to use RPM directly, but instead provide smooth tools that use RPM behind-the-scenes.

    This has gotten longer than I expected; I'd appreciate constructive replies.

  • I run a busy (military) website myself, and I've found that a lot of the users on the site don't use the site in the same way I would. They get the information they need, and they put up with a sub-optimal interface, but if I can find out what they're trying to do it's often a matter of a simple change to allow them to do it with a lot more efficiency.

    I apologize if it seemed a personal attack, it wasn't. I defiantely wish you luck, but it's not going to happen. People who are used to what you think is sub-optimal (and yes, genuine crap does exist), are going to complain when you make a change. How far do you take that? Let the users build their own interfaces? Maybe the interface to build your own interface is confusing to some..

    How do you say Tomato, Tomato in text?
    Personally, I think economics is crap theory too.
    You can take any course or track, and learn a LOT of detail about that particular subject. Some you'll agree with, some you won't.

    A college degree doesn't necessarily make something/someone viable. So don't accept that just because someone is being taught something, that they'll know all there is to know.
    Just stay open to opinions..

  • Re:Yeah, right. (Score:3, Insightful)

    by cjpez ( 148000 ) on Tuesday April 09, 2002 @03:39PM (#3311648) Homepage Journal
    Okay, so don't use Gentoo, then. If you could walk into a Best Buy and purchase a copy of Gentoo, I'm guessing that listed alongside the hardware requirements there'd be "broadband internet connection."

    Nobody's forcing you to use Gentoo over a modem connection; to say that it sucks because it requires something you don't have is just insane. It's like me complaining that Quake 3 sucks because I'm running in software mode on a card w/ 4MB of memory.

  • Check out auto-apt (Score:3, Insightful)

    by Pfhor ( 40220 ) on Tuesday April 09, 2002 @03:40PM (#3311660) Homepage
    auto-apt run ./configure

    monitors what files the ./configure file probes for, and will install the packages that contains them (makes it easier than hunting for libraries, or you are uncertain of the deb name, etc.)

    really quite spiffy.

    http://qref.sourceforge.net/quick/index.en.html
    Needs to be listed more clearly, is an awesome reference, took me a while to find it through their page. (Also needs more people to contribute, since I believe it is just one guys experience)
  • by glwtta ( 532858 ) on Tuesday April 09, 2002 @04:30PM (#3311994) Homepage
    I am sure this has been pointed out already, but I'll throw my vote in - of course you'll find the install process dificult if you are using "advanced" distros, it's kind of like saying that LFS [linuxfromscratch.org] is "not there yet" because the install process is complicated.

    Mandrake's installer beats any Windows installation hands down (of course Windows users rarely install it, but anyway); if someone not familiar with the Linux vs. Windows FUD were shown the installation of Win2K (for example) and an 8.x Mandrake, they'd simply laugh if they were told that Windows is the "user friendly" one. And RedHat's not far behind (behind Mandrake that is, not Windows) in that department, either.

    Of course you'll always have the extra step of selecting software to install to complicate things. I just love it when people use these arguments - "Linux is too dificult - it comes with software!"

  • by auferstehung ( 150494 ) <tod.und.auferstehung bei gmail.com> on Tuesday April 09, 2002 @05:19PM (#3312292)

    One of Gentoo's many features is profiles, i.e. lists of packages that that describe your installed system. The default profile is a minimal console installation.

    You could, if you desired, make a custom profile describing the linux installation of your dreams. (Hint for Gentoo users: the system profile is determined by the symlink /etc/make.profile that by default points to /usr/portage/profiles/default-1.0 )

    For example you could have server, workstation, BBC, mosix-cluster, etc profiles. A generous use of the --buildpkg flag for emerge (or the lower level, 'ebuild foo.ebuild package') and you have a collection of binary packages ripe for distribution as a, well, distribution. Hence, the concept of meta-distribution.

  • by damiam ( 409504 ) on Tuesday April 09, 2002 @06:00PM (#3312532)
    That's only cause it was copied straight from k5.
  • by Da Masta ( 238687 ) <.dmu_net. .at. .hotmail.com.> on Tuesday April 09, 2002 @07:41PM (#3313100)
    ...is its attention to detail and aesthetics and its general sexiness (the word I was going to use slipped my mind -- I'm an eloquent speaker, trust me).

    After evolving from Mandrake and other n3wb distros, the typical linux user has the choice between Slackware, Debian, and LFS style distros. All of them are great for proclaiming one's leetness. Just being able to go through the installation process of any of the aforementioned is a testament to manliness even penis length cannot surmount.

    But what to do after that? Sure you got a badassed mofo distro, but it looks like shit! LFS and Slack use the horrid BSD style init-scripts (don't flame me...just from my experience from atleast a few years back, not that slack's updated versions since then ;-). Slack and LFS don't have decent package management/upgrading systems. Ever notice how slack packages show full version numbers in pkgtool ONLY for packages that were installed during setup, and not the ones you add later? And to add to that, NONE of the distros mentioned have good looking Redhat style init scripts that have the [OK] and the [Failed] signals to warn you how poorly you set up the system.

    Gentoo has all that and more. By default, it sets up color terminals for all users. No more fidgeting with .bashrc to add colour to your ls's. It makes everything setup sexily across your system. Every package that doesnt follow the system is setup under opt. It even thinks about what to do AFTER you get linux installed1 In debian you could always upgrade to SID and try to fix bugs in your packages. In LFS, you could always try to reinstall, and try to remember without looking all the urls for downloading all the patchfixes for all the packages, and race friends to see who can finish first. Slack doesn't have anything for that -- but never fear, gentoo does. After you setup the system, you can always try to figure out why you cant install vmware, or why certain packages are there in the portage tree but dont seem to install.

    And you can do it all with full colour ls listings. And that's enough rambling and bitching for me today.

Remember to say hello to your bank teller.

Working...