Homepage: http://linux.50webs.org/
Forums: (No Registration Necessary)


 GENTOO 2006.0, Gnome, KDE and 
 Xfce in less than 180 minutes. 


GENTOO 2006.0 and the Gnome desktop installs in less than 15 minutes.
And that is with a 750 MHz Duron processor and 512 MB of RAM.

 Installation from CD or Iso-Image.

First, the Gentoo 2006 Live-CD is only available for the X86 and PPC architectures.
All other architectures should use this guide for 2005.1 and make the obvious changes.

Second, we assume you have Linux installed on (at least) one partition.
And that you have an empty partition that is larger than 4 GB (to install Gentoo on).

Third, we assume you have squash filesystem support. This can be in the form of a kernel module, or just the program unsquashfs. See this article, if you need to obtain these. You can even use the squash filesystem support of the LiveCD itself (see below).

Fourth, we assume that the Live-CD provides a configuration of the graphics environment X, that you can live with. Of course, if you are not happy with the default X configuration, then it can be changed to your liking, after the installation is complete.

Fifth, it is always assumed that you are the root user.

What you need:

The Gentoo 2006 Live-CD, or its Iso-Image, livecd-i686-installer-2006.0.iso (697 MB)

What you might want:

The Gentoo 2005.1 packages-CD, or its Iso-Image, packages-x86-2005.1.iso (696 MB)
The packages openldap-2.2.28.tgz and openldap-2.1.30.tgz

What you will get:

After installation from the Gentoo 2006 Live-CD, or its Iso-Image, you will have an up to date version of the Gnome desktop and most basic Linux/GNU software.

What you will NOT get from the Gentoo 2006 Live-CD:

The KDE desktop is absent from the CD. In order to keep you from using the KDE desktop, the customary second packages-CD, is not provided. As with the Gentoo 2005.1 CD, Gentoo has deliberately made it difficult for you to install the KDE desktop. Clearly,

Gentoo does NOT want you to use the KDE desktop

and for some reason, wishes to force you to use the Gnome desktop.

However, there are a number of ways of adding the KDE desktop.

What you will also get if you have the Gentoo 2005.1 packages-CD:

If you have the Gentoo 2005.1 packages-CD, or its Iso-Image, packages-x86-2005.1.iso, then you can install the binary packages from it. This will take about two hours and will provide you with KDE 3.4.1.

Or alternatively, you can use portage to download all the necessary packages and compile them (all 268 of them). This takes over 18 hours, but will provide you with KDE 3.4.3.

Most people will not notice the difference between KDE 3.4.1 and 3.4.3.

Xfce has not changed at all since Gentoo 2005.1.

So lets begin.

Start Linux (a version with squash filesystem support). Enter;

 fdisk -l | awk '{if(/^\/dev/)print $1}'

to list the partitions available for you to install Gentoo on. The partition you choose for the installation, may be on the same hard disk, or a second, or third,... hard disk.

I chose the first partition of my first hard disk, /dev/hda1, for the installation.

If your chosen partition is not empty, then you should delete all the files, or reformat it, with the command:

mkfs.reiserfs /dev/hdaX

You need to do this before mounting /dev/hdaX. Of course, change /dev/hdaX as necessary.

I will assume that the downloaded Iso-Images and packages have been saved in the directory /iso

 mkdir /g /s /1

/g will be the mount point for the Gentoo 2006.0 Iso-Image or CD.
/s will be the mount point for the squashed filesystem image.squashfs
/1 will be the mount point for the partition on which Gentoo will be installed.

 mount -t iso9660 -o loop /iso/livecd-i686-installer-2006.0.iso /g
 mount -t squashfs -o loop /g/image.squashfs /s
 mount -t reiserfs /dev/hda1 /1  (change reiserfs if necessary)

The -t flag in the last command is often not necessary, as many filesystems are recognized automatically. Mount is known to recognize the adfs, bfs, cramfs, ext, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, ntfs, qnx4, reiserfs, romfs, udf, ufs, vxfs, xfs and xiafs filesystems. So the following command would work just as well:

 mount /dev/hda1 /1

If you have the 2006.0 installation CD (and not the Iso-Image) then you will want to mount it instead;

 mount -t iso9660 /dev/hdc /g  or just  mount /dev/hdc /g

Adjust /dev/hdc to reflect the correct device name of your CD/DVD reader. If you do not know its device name, the following command should tell you:

 awk '{if(/name/)print "/dev/"$NF}' /proc/sys/dev/cdrom/info

Now we copy over the entire filesystem:

 cd /s; tar -cpf - * | tar -C /1 -xvpf -

If you do not have the squash filesystem kernel module, you will not have been able to mount /g/image.squashfs on /s. In this case you need to use the LiveCD's squash filesystem support (see below), or the program unsquashfs, as follows:

 cd /1; unsquashfs /g/image.squashfs
 mv /1/squashfs-root/* /1; rmdir /1/squashfs-root

Continuing, we unpackage a couple of archives:

 tar -xvjpf /g/snapshots/portage-20060123.tar.bz2 -C /1/usr/
 tar -xvjpf /1/usr/livecd/metadata.tar.bz2 -C /1

We move a couple of files to their correct places:

 mkdir /1/usr/portage/distfiles
 cp /iso/openldap* /1/usr/portage/distfiles

And clean up a few Gentoo-installer related items:

 mv /1/usr/livecd/gconf /1/etc
 mv /1/usr/livecd/db /1/var
 rm -fr /1/usr/livecd
 rm -f /1/home/gentoo/Desktop/*
 rm -f /1/etc/runlevels/default/{pwgen,local}  (important)

Now it only remains to adjust a few configuration files.

 rm -i /1/etc/fstab  (delete the old fstab file)
 emacs /1/etc/fstab &

Recreate /1/etc/fstab with your favorite editor (I used emacs) and copy the following to it:

#filesystem mount-dir fs-typeoptionsdump fsck-order
/dev/hda1/reiserfsnotail11
/dev/hda2swapswapdefaults00
none/procprocdefaults00
none/dev/shmtmpfsdefaults00
/dev/fd0/avfatuser,noauto00
/dev/hdc/cdiso9660 user,noauto,ro,exec 00

Do not forget to alter the filesystem type and options of the install partition, the device name of your swap partition, and the device name of your CD/DVD reader, as necessary.

 cp /boot/grub/menu.lst /boot/grub/menu.lst.old  (save old grub config)
 emacs /boot/grub/menu.lst &

In order to boot your newly installed copy of Gentoo, you need to have the boot manager, grub, add it to the menu of bootable partitions displayed at boot. This is achieved by adding the following entry to your /boot/grub/menu.lst file:

title LiveCDKernel Gentoo 2006.0
kernel (hd0,0)/boot/kernel-genkernel-x86-2.6.15-gentoo-r5 root=/dev/ram0 real_root=/dev/hda1
initrd (hd0,0)/boot/initramfs-genkernel-x86-2.6.15-gentoo-r5


If your menu.lst file resides on a partition other than the one you booted, then you will have to mount that partition, say on /mnt, and edit /mnt/boot/grub/menu.lst (if you have booted the LiveCD, then do NOT use /mnt). Of course, if you have a separate /boot partition, this cannot happen. The point is, that you have to edit the copy of menu.lst on the partition that grub reads when it boots your computer. The partition in which grub looks for menu.lst, is called the root partition.

If you know, or expect, you will have trouble with the X configuration, then you should add the option nox to the kernel line of the grub entry, ie,

kernel (hd0,0)/boot/kernel-genkernel-x86-2.6.15-gentoo-r5 root=/dev/ram0 real_root=/dev/hda1 nox

This will stop the graphics environment being started at boot. In fact, if you anticipate problems, it might pay to have two grub entries for Gentoo 2006, one with nox and one without it.

Since you are installing from a pre-existing Linux partition, one assumes that you already have a working X configuration file xorg.conf. If it produces a better graphics environment than that produced automatically by the Live-CD init script x-setup then you should copy it to Gentoo now (for later use):

 cp /etc/X11/xorg.conf /home/gentoo

Lastly, you must set the root password. If you do not do this, you will not be able to log in, after rebooting:

 chroot /1 /bin/bash
 passwd

Enter some easy to remember password like p. You can worry about securing your system once it is running. Similarly, you can worry about configuring internet access, your host and domain names, timezone, etc, once your system is up and running.

 exit
 reboot

After rebooting, choose LiveCDKernel Gentoo 2006.0 from the grub menu and get Gentoo started. The Gnome desktop will be started automatically. If you are not familiar with Gnome, have a look around for a minute, before getting on with the task of setting up KDE and Xfce.


 Setting up the graphics environment


If you are happy with the graphics environment automatically setup by the Live-CD init script x-setup, then do nothing. If your usual graphics environment is superior, then you can replace the automatically generated xorg.conf with your own and stop the script x-setup, from starting at boot, with the commands:

 cp /etc/X11/xorg.conf /etc/X11/xorg.conf.old
 cp /home/gentoo/xorg.conf /etc/X11/xorg.conf
 rm -f /etc/runlevels/default/x-setup; chmod -x /etc/init.d/x-setup

This will NOT work for xorg.conf files coming from proprietary ATI or Nvidia installs.


 Setting up KDE and Xfce


As mentioned above, the Gentoo Live-CD does not include binaries for KDE or Xfce, however, if you have your Gentoo 2005.1 packages CD, or its Iso-Image, handy, then KDE and Xfce can be installed from it. If you try to emerge KDE as usual, the emerge fails after about 40 packages. This is due to notational change between 2005.1 and 2006. The command:

enewuser ldap 439 /bin/false /usr/lib/openldap ldap

in the ebuild within the source package openldap-2.1.30.tar.gz, has to be replaced by:

enewuser ldap 439 -1 /usr/lib/openldap ldap

This "accidentally" breaks the installation of KDE. To get around this problem you need to download the packages openldap-2.2.28.tgz and openldap-2.1.30.tgz and emerge them before emerging KDE.

So lets mount everything and emerge KDE and Xfce. First we must mount the partition that contains the 2005.1 packages Iso-Image. This will usually be the partition you initially booted (in my case /dev/hda3).

 mkdir /a /cd
 mount -t reiserfs /dev/hda3 /a  (change reiserfs to your filesystem type)
 mount -t iso9660 -o loop /a/iso/packages-x86-2005.1.iso /cd

If you have the 2005.1 packages CD (and not the Iso-Image) then you will want to mount it instead;

 mount -t iso9660 /dev/hdc /cd  (change /dev/hdc if necessary)

or just mount /cd. Ok, nearly there. Emerge openldap. Then emerge KDE and Xfce and the installation is complete:

 emerge openldap
 export PKGDIR=/cd/
 emerge --usepkgonly kde-meta
 emerge --usepkgonly xfce4

And how to fix emacs? How about you telling me. It turns out that emacs at 1024x768 does not work (can't find the right fonts), whereas, emacs at 1280x1024 works fine.


 What to do if you don't have Squash filesystem support.


Of course, the best option is to add it. Second best, is to use the Squash filesystem support of the Live-CD. Logging in as root, has deliberately been made difficult. If you log in as the default user, gentoo, you will not be able to su to become root. The secret is to boot the Live-CD without X and change the root password before starting Gnome. This is done by entering:

boot:  gentoo nox

when the Live-CD gives you the opportunity to enter kernel parameters before booting. After booting enter:

 passwd root

and change the root password to something easy to remember like p. Then enter:

 gdm

to start the Gnome desktop. Log in as root. Open a terminal window and enter:

 mkdir /1 /3
 mount -t reiserfs /dev/hda1 /1  (change reiserfs to your filesystem type)
 cd /mnt/livecd; tar cf - * | tar -C /1 -xvf -
 rm -f /1/usr/portage/{profiles,eclass}
 tar -xjpf /mnt/cdrom/snapshots/portage-20060123.tar.bz2 -C /1/usr/
 tar -xvjpf /1/usr/livecd/metadata.tar.bz2 -C /1

The partition containing the directory /iso, which contains the openldap files, now has to be mounted in order to access them (do not mount it on /mnt as this will cut off access to all commands (not good)). Do this with commands something like:

 mount -t reiserfs /dev/hda3 /3
 mkdir /1/usr/portage/distfiles
 cp /3/iso/openldap* /1/usr/portage/distfiles

Then continue as above from the command:

 mv /1/usr/livecd/gconf /1/etc

Note that the grub root partition will not be the partition that you are installing Gentoo on. It will most likely be the partition that has been mounted on /3. And then you will edit /3/boot/grub/menu.lst as shown above. If the grub root partition is not already mounted, then mount it and add a Gentoo entry to the file menu.lst. Of course, if you have a separate /boot partition, then you only have one menu.lst file, and don't have to worry about all the multiple copies of it (although you constantly have to worry about it being over-written on each new install).

So, installing Gentoo is easy. Hope it all went well.

Please report any errors in the forum.

 AS ALWAYS, USE AT OWN RISK.