Quick Installation Checklist - Gentoo wiki (2024)

This article has been created for experienced users who desire a quick, less detailed installation guide. It doubles as a checklist so essential installation steps are not forgotten.

Warning
This article is outdated and will be replaced soon. Until then, the draft can be used temporarily: User:Pietinger/Draft/Quick_Installation_OpenRC_for_an_UEFI_System.

Contents

  • 1 Format drive
    • 1.1 BIOS/MBR
    • 1.2 BIOS/GPT
    • 1.3 UEFI/GPT
  • 2 Mount partitions
    • 2.1 BIOS/MBR
    • 2.2 BIOS/GPT
    • 2.3 UEFI/GPT
  • 3 Stage 3
  • 4 Chroot
  • 5 Portage
  • 6 User accounts
  • 7 Configure system
    • 7.1 Install vi (optional)
    • 7.2 Editing the fstab file
    • 7.3 Locale
    • 7.4 Hostname
    • 7.5 Timezone
  • 8 Kernel
    • 8.1 Emerge
    • 8.2 Configure
      • 8.2.1 Manual
      • 8.2.2 Automatic
    • 8.3 Install
  • 9 Alternative: Using a distribution kernel
    • 9.1 Install
  • 10 Bootloader
  • 11 Network
  • 12 Clean up
  • 13 See also

Format drive

Note
If building within a QEMU or using a VirtIO driver, probably have to substitute the drive/partition name sda with vda throughout this article.

BIOS/MBR

Create three partitions. 128MB for /boot, 1024MB for swap, and the rest for /

root #cfdisk /dev/sda

Format the partitions:

root #mkfs.ext4 /dev/sda1

root #mkfs.ext4 /dev/sda3

root #mkswap /dev/sda2 && swapon /dev/sda2

BIOS/GPT

Create four partitions. 128MB for /boot, 2MB for BIOS Boot, 1024MB swap and the rest goes to /

root #gdisk /dev/sda

Create GPT partition table:Command: o ↵This option deletes all partitions and creates a new protective MBR.Proceed? (Y/N): y ↵Create Partition 1 (/boot):Command: n ↵Partition Number: 1 ↵First sector: ↵Last sector: +128M ↵Hex Code: ↵Create Partition 2 (BIOS boot):Command: n ↵Partition Number: 2 ↵First sector: ↵Last sector: +2M ↵Hex Code: EF02 ↵Create Partition 3 (swap):Command: n ↵Partition Number: 3 ↵First sector: ↵Last sector: +1024MB ↵Hex Code: 8200 ↵Create Partition 4 (/):Command: n ↵Partition Number: 4 ↵First sector: ↵Last sector: ↵ (for rest of disk)Hex Code: ↵Write Partition Table To Disk:Command: w ↵Do you want to proceed? (Y/N): Y ↵

Format the partitions:

root #mkfs.ext4 /dev/sda1

root #mkfs.ext4 /dev/sda4

root #mkswap /dev/sda3 && swapon /dev/sda3

UEFI/GPT

Create four partitions. 128MB for /boot, 128MB for UEFI ESP, 1024MB swap and the rest goes to /

root #gdisk /dev/sda

Create GPT partition table:Command: o ↵This option deletes all partitions and creates a new protective MBR.Proceed? (Y/N): y ↵Create Partition 1 (/boot):Command: n ↵Partition Number: 1 ↵First sector: ↵Last sector: +128M ↵Hex Code: ↵Create Partition 2 (UEFI ESP):Command: n ↵Partition Number: 2 ↵First sector: ↵Last sector: +128M ↵Hex Code: EF00 ↵Create Partition 3 (swap):Command: n ↵Partition Number: 3 ↵First sector: ↵Last sector: +1024MB ↵Hex Code: 8200 ↵Create Partition 4 (/):Command: n ↵Partition Number: 4 ↵First sector: ↵Last sector: ↵ (for rest of disk)Hex Code: ↵Write Partition Table To Disk:Command: w ↵Do you want to proceed? (Y/N): Y ↵

Format the partitions:

root #mkfs.ext4 /dev/sda1

root #mkfs.ext4 /dev/sda4

root #mkswap /dev/sda3 && swapon /dev/sda3

root #mkfs.vfat -F 32 /dev/sda2

Mount partitions

BIOS/MBR

root #mkdir -p /mnt/gentoo

root #mount /dev/sda3 /mnt/gentoo

root #mkdir /mnt/gentoo/boot

root #mount /dev/sda1 /mnt/gentoo/boot

BIOS/GPT

root #mkdir -p /mnt/gentoo

root #mount /dev/sda4 /mnt/gentoo

root #mkdir /mnt/gentoo/boot

root #mount /dev/sda1 /mnt/gentoo/boot

UEFI/GPT

root #mkdir -p /mnt/gentoo

root #mount /dev/sda4 /mnt/gentoo

root #mkdir /mnt/gentoo/boot

root #mount /dev/sda1 /mnt/gentoo/boot

root #mkdir /mnt/gentoo/boot/efi

root #mount /dev/sda2 /mnt/gentoo/boot/efi

Stage 3

Find nearest mirror from this list.

Navigate to the /mnt/gentoo directory:

root #cd /mnt/gentoo

Download the stage 3. Be sure to replace the keyword (amd64 and date stamp in the example below) with the correct architecture and date:

root #wget https://distfiles.gentoo.org/releases/amd64/autobuilds/current-stage3-amd64-openrc/stage3-amd64-openrc-20220320T170531Z.tar.xz


Unpack the stage 3 file:

root #tar xpf stage3*

(or with xattrs):

root #tar --xattrs-include='*.*' --numeric-owner -xpf stage3*

Chroot

Chroot into the extracted stage3:

root #cd /mnt/gentoo

root #mount --types proc /proc /mnt/gentoo/proc

root #mount --rbind /sys /mnt/gentoo/sys

root #mount --make-rslave /mnt/gentoo/sys

root #mount --rbind /dev /mnt/gentoo/dev

root #mount --make-rslave /mnt/gentoo/dev

root #mount --bind /run /mnt/gentoo/run

root #mount --make-slave /mnt/gentoo/run

root #cp /etc/resolv.conf etc && chroot . /bin/bash

root #source /etc/profile

or if using Gentoo installation media:

root #cd /mnt/gentoo && cp /etc/resolv.conf etc && arch-chroot .

Portage

Note
Don't forget to edit the make.conf file and configure ebuild repository.

Sync the Gentoo repository and update the @world set:

root #emerge-webrsync

root #emerge -avuDN @world

User accounts

Change the root password:

root #passwd

Create user(s):

root #useradd -g users -G wheel,portage,audio,video,usb,cdrom -m username

root #passwd username

Note
Spaces are not allowed between groups.

Configure system

Install vi (optional)

Note
vi installation is optional, you can use nano as it is a default editor in stage3.

root #emerge -vq vim

Editing the fstab file

Configure /etc/fstab to match the actual partitioning performed in the step above:

FILE /etc/fstab

/dev/sda1/bootvfatnoauto,noatime1 2/dev/sda3/ext4noatime0 1/dev/sda2noneswapsw0 0/dev/cdrom/mnt/cdromautonoauto,ro0 0

Locale

Set system locale:

FILE /etc/env.d/02localeExample locale configuration

LANG="en_US.UTF-8"LC_COLLATE="C"

Add the locale to /etc/locale.gen:

FILE /etc/locale.genExample locale configuration

en_US.UTF-8 UTF-8C.UTF8 UTF-8

then generate the locale:

root #locale-gen

Hostname

Edit /etc/conf.d/hostname

FILE /etc/conf.d/hostnameExample Hostname configuration

HOSTNAME="pc"

Timezone

Set the appropriate timezone:

root #ln -sf /usr/share/zoneinfo/Europe/Helsinki /etc/localtime

Kernel

Emerge

The sys-kernel/gentoo-sources package is the vanilla kernel with the Gentoo patchset applied. Choose between kernel sources. The sys-kernel/linux-firmware package contains binary blobs needed for some hardware (WLAN cards).

If sys-kernel/gentoo-sources has been selected:

root #echo "sys-kernel/linux-firmware @BINARY-REDISTRIBUTABLE" | tee -a /etc/portage/package.license

root #emerge -av sys-kernel/gentoo-sources sys-kernel/linux-firmware sys-kernel/installkernel

root #ln -s /usr/src/linux* /usr/src/linux

root #cd /usr/src/linux

Configure

Manual

Install sys-apps/pciutils

root #emerge -av pciutils

Discover which modules are required for the system's hardware:

root #lspci -nnk

Shorter version:

root #lspci -nnk | grep "Kernel driver in use:"

Configure kernel by enabling each necessary module in the menuconfig interface. Search for specific module names by pressing / in menuconfig. Navigate to the associated feature by pressing the corresponding number listed on the left of the search results.

root #make menuconfig

Once finished build kernel and modules:

root #make -j2

Automatic

If things are working nicely in the current install environment, it is possible to use localyesconfig to select all modules currently loaded by the LiveCD:

root #make localyesconfig

Build the kernel and modules:

root #make -j2

Install

Install the kernel and modules:

root #make modules_install

root #make install

Alternative: Using a distribution kernel

If manually installing the kernel looks too hard. try distribution kernels.

Distribution kernels are ebuilds that automate the process of unpacking, configuring, compiling, installing the kernel.

For systemd-boot:

root #emerge --ask sys-kernel/installkernel-systemd

For GRUB, LILO, etc:

root #emerge --ask sys-kernel/installkernel-gentoo

Install

To build the kernel from source:

root #emerge --ask sys-kernel/gentoo-kernel

To install precompiled kernel images rather than compiling the kernel:

root #emerge --ask sys-kernel/gentoo-kernel-bin

Bootloader

Specify the correct setting for the system's firmware. BIOS/MBR is pc, 64-bit UEFI is efi-64, 32-bit UEFI is efi-32:

Note
32-bit UEFI is rare to find on PCs. Mostly older Apple hardware use this. It has nothing to do with the Gentoo architecture chosen.

if you decide to use systemd-boot install sys-boot/systemd-boot

Emerge GRUB:

root #echo 'GRUB_PLATFORMS="efi-64"' >> /etc/portage/make.conf

root #emerge --ask sys-boot/grub

Assuming the system has BIOS firmware:

root #grub-install /dev/sda

Supposing the system has UEFI firmware and the EFI partition is mounted in the /boot/efi directory:

root #grub-install --target=x86_64-efi --efi-directory=/boot/efi

Use the grub-mkconfig command to generate the configuration file:

root #grub-mkconfig -o /boot/grub/grub.cfg

Found vmlinuz-3.14.4-gentoo

Network

For ethernet install dhcpcd:

root #emerge --ask net-misc/dhcpcd

To start dhcpcd at boot:

root #rc-update add dhcpcd default

root #rc-service dhcpcd start

For wireless networks install wpa_supplicant and iw:

root #emerge --ask sys-apps/iproute2 net-wireless/wpa_supplicant net-wireless/iw net-wireless/wireless-tools

Clean up

Exit chroot, unmount partitions, and reboot:

root #exit

root #umount -R /mnt/gentoo

root #reboot

See also

  • Gentoo Handbook — an effort to centralize essential documentation for initial Gentoo installation and basic system administration.
  • Installation — an overview of the principles and practices of installing Gentoo on a running system.
Quick Installation Checklist - Gentoo wiki (2024)
Top Articles
Latest Posts
Article information

Author: Zonia Mosciski DO

Last Updated:

Views: 6141

Rating: 4 / 5 (51 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Zonia Mosciski DO

Birthday: 1996-05-16

Address: Suite 228 919 Deana Ford, Lake Meridithberg, NE 60017-4257

Phone: +2613987384138

Job: Chief Retail Officer

Hobby: Tai chi, Dowsing, Poi, Letterboxing, Watching movies, Video gaming, Singing

Introduction: My name is Zonia Mosciski DO, I am a enchanting, joyous, lovely, successful, hilarious, tender, outstanding person who loves writing and wants to share my knowledge and understanding with you.