This article is for those whom desire a quick and specific installation guide. It also makes a sufficient checklist to ensure nothing is missing.
By the time you are done, you should have a minimal AMD64 system capable of standing on its own 2 feet. Written using the Archlinux Installation Media as a means for Chrooting.
Any Linux Live Media will work. This guide is only compatible with all 64-Bit X86 Intel, AMD and VIA chipsets. Most PCs, Laptops and Macs fall under this range.
This is not an official Gentoo Wiki page. Please provide this resource in the Gentoo forums if you run into trouble. The content below is a modified version of this wiki page.
THIS STEP WILL WIPE YOUR DRIVE! If you are unwilling to do so, please do not follow this guide and refer to the Gentoo Handbook instead.
Create two partitions. 1024MB for swap and the rest for /
root # cfdisk /dev/sdaFormat the partitions:
root # mkfs.ext4 /dev/sda1
root # mkfs.ext4 /dev/sda3
root # mkswap /dev/sda2 && swapon /dev/sda2
Format the partitions as Extended File System Version 4. Assumes sda1 is root:
root # mkfs.ext4 /dev/sda1
root # mkswap /dev/sda2 && swapon /dev/sda2
For NVME, it's safe to assume nvme0n1 instead of sda. Partition scheming for NVME is a bit different, being nvme0n1pX instead of sdaX.
Create three partitions. 300MB for EFI, 1024MB swap and the rest goes for /
root # fdisk /dev/sda
Command (m for help): g
Created a new GPT disklabel (GUID: 15E591FB-FA4B-422E-91F7-BF2F82013199).
Command (m for help): n ↵
Partition number (1-128, default 1): ↵
First sector (2048-7814037134, default 2048): ↵
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-7814037134, default 7814035455): +300M ↵
Created a new partition 1 of type 'Linux filesystem' and of size 300 MiB.
Command (m for help): n ↵
Partition number (2-128, default 2): ↵
First sector (616448-7814037134, default 616448): ↵
Last sector, +/-sectors or +/-size{K,M,G,T,P} (616448-7814037134, default 7814035455): +1024M ↵
Created a new partition 2 of type 'Linux filesystem' and of size 1 GiB.
Command (m for help): n ↵
Partition number (3-128, default 3): ↵
First sector (2713600-7814037134, default 2713600): 2 ↵
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2713600-7814037134, default 7814035455): ↵
Created a new partition 3 of type 'Linux filesystem' and of size 3.6 TiB. ↵
Command (m for help): w ↵
Format the partitions as Extended File System Version 4:
root # mkfs.vfat /dev/sda1
root # mkswap /dev/sda2
root # swapon /dev/sda2
root # mkfs.ext4 /dev/sda3
root # mount /dev/sda3 /mnt
root # mkdir /mnt/boot
root # mount /dev/sda1 /mnt/boot
root # mount /dev/sda4 /mnt/gentoo
root # mount /dev/sda1 /mnt/boot
root # mkdir -p /mnt/boot/efi
root # mount /dev/sda2 /mnt/boot/efi
Find nearest mirror from this list.
Navigate to the /mnt directory:
root # cd /mntDownload the stage3 tarball of your choosing. This guide assumes you are using an OpenRC stage. Please ensure the links package (links2 on debian distros) is installed on host media.
root # links https://distfiles.gentoo.org/releases/amd64/autobuilds/
Unpack the stage 3 file:
root # tar -xpfv --xattrs-include='*.*' --numeric-owner stage3*#don't use the verbose (v) flag on slow TTYs.Chroot into the extracted stage3:
root # cd /mnt/
root # mount --types proc /proc /mnt/procroot # mount --bind /sys /mnt/sysroot # root # mount --bind /dev /mnt/dev
root # mount --bind /run /mnt/run
root # cp /etc/resolv.conf etc && chroot . /bin/bash
root # source /etc/profileor if using Gentoo installation media:
root # cd /mnt/gentoo && cp /etc/resolv.conf etc && arch-chroot .Don't forget to edit the make.conf file and configure ebuild repository.
Sync the Gentoo repository and update the @world set:
root # emerge-webrsyncroot # emerge -avuDN @worldChange the root password:
root # passwdCreate user(s):
root # useradd -m username
root # usermod -a -G wheel,portage,audio,video,usb,cdrom username
root # passwd usernameroot # emerge -vq vimConfigure /etc/fstab to match the actual partitioning performed in the step above:
/etc/fstab/dev/sda1 /boot vfat noauto,noatime 1 2
/dev/sda3 / ext4 noatime 0 1
/dev/sda2 none swap sw 0 0
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
Set system locale:
/etc/env.d/02locale Example locale configurationLANG="en_US.UTF-8"
LC_COLLATE="C"
Add the locale to /etc/locale.gen :
/etc/locale.genExample locale configurationen_US.UTF-8 UTF-8
C.UTF8 UTF-8
then generate the locale:
root # locale-genEdit /etc/conf.d/hostname
/etc/conf.d/hostnameExample Hostname configurationHOSTNAME="Gentoo"
Set the appropriate timezone. Substitute America/New_York with your Timezone:
root # ln -sf /usr/share/zoneinfo/America/New_York /etc/localtimeTo build the kernel from source with global use flags:
root # emerge -av sys-kernel/gentoo-kernel sys-kernel/linux-headers sys-kernel/linux-firmware --autounmask=y --autounmask-writeroot # dispatch-confTo install precompiled kernel images rather than compiling the kernel:
root # emerge -av sys-kernel/gentoo-kernel-bin sys-kernel/linux-headers sys-kernel/linux-firmware --autounmask=y --autounmask-writeroot # dispatch-confSpecify the correct setting for the system's firmware. BIOS/MBR is pc, 64-bit UEFI is efi-64, 32-bit UEFI is efi-32:
32-bit
EFI is usually older Apple hardware. It
has nothing to do with the Processor architecture.Emerge GRUB:
root # echo 'GRUB_PLATFORMS="efi-64"' >> /etc/portage/make.confroot # emerge -av sys-boot/grubAssuming the system has BIOS firmware:
root # grub-install /dev/sdaSupposing 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 --removableUse the grub-mkconfig command to generate the configuration file:
root # grub-mkconfig -o /boot/grub/grub.cfgFound vmlinuz-3.14.4-gentoo
For ethernet install dhcpcd:
root # emerge -av net-misc/dhcpcdroot # rc-update add dhcpcd defaultFor wireless networks install Network Manager (with wifi use flag):
root # emerge -av networkmanagerroot # rc-update add NetworkManager defaultroot # rc-service NetworkManager startroot # nmtuiAlternatively use iwd and dhcpcd:
root # emerge -av iproute2 iwd wireless-tools dhcpcdroot # rc-update add iwd defaultroot # rc-update add dhcpcd defaultroot # rc-service iwd startroot # iwctl[iwd]# exitExit chroot, unmount partitions, and reboot:
root # exit
root # umount -R /mntroot # rebootAssuming you configured everything according to this wiki, you should have a bootable system, albiet a minimal one. If you missed something, you can boot the live media and return to the Mount partitions section.