Gentoo: Installation

Installing Operating System

Check date and time are correct: (It should be UTC!)


Sync NTP

ntpd -q -g

Downloading the stage tarball

cd /mnt/gentoo

Select a stage 3 tarball from the Gentoo site

  • Should generally use a multilib (32/64) tarball
  • Can use systemd instead of openrc

Download the tarball and the signature:



Verify the signatures:

gpg --keyserver --recv-keys BB572E0E2D182910

gpg --verify stage3-amd64~~~.tar.xz.DIGESTS.asc

sha512sum -c stage3-amd64~~~.tar.xz.DIGESTS.asc

Extract the tarball

Extract the tarball to the root directory of the install:

cd /mnt/gentoo
tar xpvf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner

Configure environment

Modify the compile flags:

# Compiler flags to set for all languages
COMMON_FLAGS="-march=native -O2 -pipe"
# Use the same settings for both variables

In the same file, set the number of threads to be used for compile, in this case a quad core system with SMT:


And configure a mirror

mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf

mkdir --parents /mnt/gentoo/etc/portage/repos.conf
cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf

Copy DNS config to the chroot

cp --dereference /etc/resolv.conf /mnt/gentoo/etc/

Bind the pseudo-filesystems to the chroot:

mount --types proc /proc /mnt/gentoo/proc 
mount --rbind /sys /mnt/gentoo/sys 
mount --make-rslave /mnt/gentoo/sys 
mount --rbind /dev /mnt/gentoo/dev 
mount --make-rslave /mnt/gentoo/dev

Configure the system

chroot /mnt/gentoo /bin/bash
. /etc/profile
export PS1="(chroot) ${PS1}"

Mount boot partition

mkdir /boot
mount /dev/sda2 /boot

Mount EFI partition

mkdir /boot/efi
mount /dev/sda1 /boot/efi

Configure portage


emerge --sync

eselect profile list

Choose a profile that you like. I like Plasma and systemd because I am a massive soyboy beta.

eselect profile set default/linux/amd64/17.0/desktop/plasma/systemd

emerge --ask --verbose --update --deep --newuse @world

Configure the timezone:

echo "America/Toronto" > /etc/timezone 
emerge --config sys-libs/timezone-data

Configure the locale:

nano /etc/locale.gen

> en_US ISO-8859-1
> en_US.UTF-8 UTF8

locale -a

Set locale for package manager and refresh environment:

eselect locale list
eselect locale set 7 (en_US.utf8)
env-update && source /etc/profile && export PS1="(chroot) $PS1"

Installing Sources

The Kernel (Source)

emerge --ask sys-kernel/gentoo-sources

emerge --ask sys-apps/pciutils

cd /usr/src/linux 
make menuconfig

Follow the directions.

Make sure the following pieces are compiled into the kernel:

  1. iwlfifi support
  2. crypt support -

Now it's compiling time.

make && make modules_install

make install

The Kernel (Binary)

Simply install the distrokernel from portage:

emerge --ask sys-kernel/installkernel-gentoo
emerge --ask sys-kernel/gentoo-kernel-bin