Gentoo Linux x86 Quick Install GuideXavier NeysSven VermeulenSteven Wagner
The Quick install guide covers the Gentoo install process in a non-verbose
manner. Its purpose is to allow users to perform a stage3 install in no time.
Users should already have prior experience with installing Gentoo Linux if they
want to follow this guide.
32006-05-15Introduction

This guide contains all commands you should use to complete a stage3
installation of Gentoo. You need a connection to the Internet to download the
stage3 and Portage snapshots.

Timing output follows all commands that take more than a couple of seconds to
finish. Commands were timed on an AMD 2000 1.66 Ghz PC with 512 Mb of RAM and
two SATA disks connected to a hardware controller.

Download a CD from one of our mirrors.
You can find the minimal CD ISO in
releases/x86/<release>/installcd or the LiveCD ISO in
releases/x86/<release>/livecd. The minimal
installation CD is only useful for Internet-based installations. You can use
the LiveCD to perform a networkless installation as documented in the
2006.0 x86 installation
handbook. The minimal CD is recommended.

Burn the CD and boot it.

Booting the CD

Press
F2 at the boot screen to find out what boot options exist. You can
either start gentoo or gentoo-nofb, the latter disables the
framebuffer. If you booted the LiveCD, don't forget to add the nox
option to prevent the X graphical environment from starting. Several options
allow to enable or disable some features. If all goes well, your hardware will
be detected and all modules will be loaded. If the kernel fails to boot
properly or if your computer hangs during the boot procedure, you may have to
experience with different configurations. The safest way is probably to use the
nodetect option and then load required modules explicitely.

If your network does not work already, you can use net-setup to configure
your network. You might need to load support for your network card using
modprobe prior to the configuration. If you have ADSL, use
adsl-setup and adsl-start. For PPTP support, first edit
/etc/ppp/chap-secrets and /etc/ppp/options.pptp and
then use pptp <server ip>.

For wireless access, use iwconfig to set the wireless parameters and then
use either net-setup again or run ifconfig, dhcpcd and/or
route manually.

If you are behind a proxy, do not forget to initialize your system using
export http_proxy, ftp_proxy and RSYNC_PROXY.

livecd root # net-setup eth0

Alternatively, you can start networking manually. The following example assigns
the IP addess 192.168.1.10 to your PC and defines 192.168.1.1 as your router
and name server.

Now, set the root password on the liveCD so that you can connect to it from
another PC. Please note that allowing root to connect over ssh is not
recommended under normal circumstances. If you can't trust your local network,
use a long and complex password, you should use it only once as it will
disappear after your first rebot.

Now, you can start a terminal on another PC and connect to your new box, follow
the rest of this guide in another window, and cut and paste commands.

(Use the IP addess of your new box)
$ ssh root@192.168.1.10
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
RSA key fingerprint is 96:e7:2d:12:ac:9c:b0:94:90:9f:40:89:b0:45:26:8f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts.
Password: type_the_password

Preparing the Disks

Use fdisk or cfdisk to create your partition layout. You need at
least a swap partition (type 82) and one Linux partition (type 83). The
following scenario creates a /boot, a swap and a main partition
as used in our handbook. The device name is likely to be either
/dev/sda for a SATA or SCSI disk, or /dev/hda for an
IDE disk.

Set your host name in /etc/conf.d/hostname and
/etc/hosts. In the following example, we use mybox as host
name and at.myplace as domain name. You can either edit the config
files with nano or use the following commands:

Configure your network in /etc/conf.d/net. Add the net.eth0
init script to the default run level. If you have multiple NICs, symlink them
to the net.eth0 init script and add them to the default run level as
well. Either edit /etc/conf.d/net with nano or use the
following commands:

Install a system logger like syslog-ng and a cron daemon like
vixie-cron, and add them to the default run level.

Cron daemons depend on an MTA. mail-mta/ssmtp will be pulled in as a
dependency. If you want to use a more advanced MTA, you might want to install
it now. If you are in a hurry, let ssmtp be installed and remove it later when
you install the MTA of your choice.

Finalizing the Installation
The total elapsed time between the display of the boot promt on the
minimal CD and the display of the login promt after the reboot was
00:42:31 on our test box. Yes, less than one hour! Note that this time
also includes the stage3, Portage snapshot and several packages download time
and the time spent configuring the kernel.

Log in as root, then add one or more users for daily use with
useradd.

(Clean up your known_hosts file because your new box
has generated a new definitive hostkey)
$ nano -w ~/.ssh/known_hosts(Look for the IP of your new PC and delete the line,
then save the file and exit nano)(Use the IP addess of your new box)
$ ssh root@192.168.1.10
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
RSA key fingerprint is 96:e7:2d:12:ac:9c:b0:94:90:9f:40:89:b0:45:26:8f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts.
Password: type_the_password

Start by selecting nearby mirrors either by defining the RSYNC and
GENTOO_MIRRORS variables in /etc/make.conf or by using
mirrorselect. You can also define the number of concurrent compilation
processes at this point.

Now is a good time to enable or disable some USE flags. Run emerge -vpe
to list all currently installed packages and their enabled and disabled USE
flags. Either edit /etc/make.conf or use the following command to
define the USE variable:

If you enabled the userlocales USE flag for versions of glibc that still
support it, you should edit /etc/locales.build and define the
locales you want to build.

Later versions of glibc ignore the userlocales USE flag and use
/etc/locale.gen instead. If you are upgrading glibc to such a
version, you should create /etc/locale.genand remove/etc/locales.build. Check the output of emerge -vpe world
to know whether glibc supports the userlocales USE flag.

Last but not least, you may want to alter the CFLAGS variable in your
/etc/make.conf to optimise the code to your specific needs. Please
note that using a long list of flags is rarely needed and can even lead to a
broken system. It is recommended to specify the processor type in the
march option and stick to -O2 -pipe.

You may also want to switch to ~x86. You should only do this if you can
deal with the odd broken ebuild or package. If you'd rather keep your system
stable, don't add the ACCEPT_KEYWORDS variable. Adding
FEATURES="parallel-fetch ccache" is also a good idea.

At the time of writing, the ~x86 version of portage is significantly
faster when updating its cache. Even if you stick to the x86 keyword, you might
want to use the ~x86 version of Portage. Check the Mixing
Stable with Testing chapter if you forgot how to do this.

You might want to recompile your whole system twice to make full use of your
latest configuration changes. It would take quite a long time to complete and
yield minimal speed benefits. It is recommended that you let your system
optimise itself gradually over time when new versions of packages are
released.

Recompiling only the packages that have already been updated since the release
or that are affected by your new USE flags will take enough time. You might
also have to remove packages that block your upgrade. Look for "[blocks
B ]" in the output of emerge -vpuD --newuse world and
use emerge -C to remove them.

(Install ccache)
mybox etc # emerge ccache(Please not that the switch to ~x86 causes many packages to be upgraded)
mybox etc # emerge -vpuD --newuse world(Take a good look at the package list and their USE flags,
remove blocking packages if any, and start the lengthy process)
mybox etc # time emerge -vuD --newuse world(79 packages have been (re)compiled)
real 180m13.276s
user 121m22.905s
sys 36m31.472s
(Remerge libtool to avoid further potential problems)
mybox etc # emerge libtool(Update config files, make sure you do not let etc-update
update config files you have edited)
mybox etc # etc-update(If perl has been updated, you should run the perl-cleaner script)
mybox etc # time perl-cleaner all
real 1m6.495s
user 0m42.699s
sys 0m10.641s
(In case of a major upgrade of python, you should run the python-updater script)
mybox etc # python-updater

What to do next

Depending on what your new Gentoo machine is supposed to do, you will probably
want to install server applications or a desktop system. Just as an example,
emerge gnome and emerge kde have been timed on the ~x86 system
installed as describe above. Both have been installed from the same starting
point.

You should check our documentation index to find out
how to install and configure the applications of your choice.

The following is only an example. It is in no way meant as a recommended setup.