Thanks to my friend Scott Robbins for his inspiration, first with his A Quick Guide to Installing ArchLinux, then his A Relatively Quick Guide to Installing Gentoo.
The Gentoo Handbook provides detailed documentation that guides you through the installation process. For me, after having installed Gentoo numerous times, there is considerably more than needed at this point. The purpose of this "Gentoo Quick Install Guide" is to cut out all the extra detail and just provide what is required to install a working headless Gentoo system for amd64 using systemd as the init system. It does have some explanation so that you can copy and paste, changing what might be specific for you, such as disk partitioning and networking. After you finish this install and reboot, it should be fairly easy to install your desktop system of choice. Mine has been Fluxbox for over 20 years. Contact me if you want any pointers.
If you've never installed Gentoo before, this guide is not for you. My recommendation would be to use the Gentoo Handbook and select the that matches your target machines.
To install according to this guide for a UEFI board using systemd as the init, you'll need to boot your target machine with a suitable media which includes systemd, UEFI support (EFI vars), and sshd. For this guide I chose to use the install-<arch>-minimal-<release timestamp>.iso from the Gentoo mirror in my country. Mine for today is the install-amd64-minimal-20251231T090058Z.iso.
Write the downloaded ISO file to bootable media and boot your target computer with it. Once you are at the livecd ~ # login prompt, read in the message of the day two items that will allow you to ssh into the computer and work from a terminal on another computer:To start an ssh server on this system, type "/etc/init.d/sshd start". If you need to log in remotely as root, type "passwd root" to reset root's password to a known value.
|
Since the Live CD starts dhcpcd, there might already be an IP address and routing configured for this computer. Issue ip a then ping -c2 gentoo.org to check. If your network connection is already working, just note the local IP to ssh into it from your source machine. If not, and you know your network, you can set a manual IP address and route, I have a HOW-TO for manually setting up a network connection . Or, if you need more help with this, the Gentoo Handbook explains several methods.
There is one more suggestion for remote installation from another computer, and that is to run tmux so that you can leave the remote session if needed without losing your work and having to start over.
|
Then from your source machine run tmux ls so that you can see your session on the other computer.
|
Now you can ssh into the machine and run tmux a -t 0 to attach to that running tmux session, and run ctrl+b d if you want to detach so that you can exit the target computer for whatever reason.
To see what disk(s) are available run lsblk with these options:
|
My target drive will be the 256GB Samsung 860 SSD. My choice for partitioning is gdisk, and this drive will have a 2GB partition for an EFI System Partition (ESP), a 12GB partition for swap, 70GB for /, and the remainder for /home. NB: Gentoo's swap recommendation.
|
Run that lsblk command again, this time with your device specified:
|
The EFI system partition (sda1 for me) must be formatted as FAT32. Choose what you want for / and/or /home. I also give my partitions labels (names) that match their mount points to more easily distinguish them in lsblk output:
|
Activate the swap partition, mount your / partition, make the directory for the ESP partition under /root, and mount /home if you have it as a separate partition:
|
Before downloading the stage file, the current directory should be set to the location of the mount used for the install:
|
The current date and time can be verified with date:
|
Using Network_Time_Protocol to correct clock skew is typically easier and more reliable than manually setting the system clock. chronyd, part of net-misc/chrony, can be used to update the system clock to UTC with:
|
A stage file, also known as a stage tarball, is an archive containing a minimal Gentoo environment, typically serving as a seed for a Gentoo install, and can be obtained from the Gentoo mirror closest to your location. Get the one that suits the type of install and init system you choose; for me today that file is a systemd desktop file. You can download the file with wget, or use links per the Gentoo Handbook's suggestion. My choice is wget with --show-progress:
|
Make sure to also get the associated checksum file (stage3-amd64-desktop-systemd-20260322T154603Z.tar.xz.sha256 is mine), verify the tarball is not corrupt, and install the files to disk.
|
We'll need a resolv.conf file for DNS resolution:
|
Then we'll use this unique genfstab bash script (from Arch Linux's pacman) to create /etc/fstab for us:
|
Check the fstab file by running egrep -v "(^#|^ *$)" /mnt/gentoo/etc/fstab to make sure the uncommented lines are correct for your system.
Now it's time to chroot (change root) into the new Gentoo system by running arch-chroot, which is another bash script on the Gentoo live media that comes from the Arch Linux camp, then set your prompt to reflect we have now moved into the chroot.
|
Next install Gentoo's ebuild repo by running emerge-webrsync, then make sure you have the correct profile selected with eselect profile show, and if it's not the one you expected, then show them all with eselect profile list|less and change it to the one you desire with eselect profile set x.
NB: Gentoo has 2 init systems - OpenRC and systemd. The profiles with systemd in the name are for it, the ones without systemd are for OpenRC. For this guide we are only going to install for systemd. This will fetch the latest snapshot (which is released on a daily basis) from one of Gentoo's mirrors and install it onto the system. It is also a good practice to read the news when you see that output after syncing.
|
There are some crucial packages that have been updated since the date of the most recent stage3-amd64-desktop-systemd tarball, so let's go ahead and update all our software now:
|
Since vim has become the only editor for me, we'll install a binary package of it now so that as we configure software we use vim, and we don't have to use nano, which is the $EDITOR of the Gentoo stage3. To get binary packages we first need to download their keys for file verification with getuto for Portage to set up the necessary keyring for verification:
|
Now set vim as your $EDITOR with these commands:
|
That should show the $EDITOR that you set.
Set your timezone and check your date ( America/Chicago is mine, choose the one appropriate to you, and tab completion works here):
|
Setup the language(s) you will use on your computer with locales. There 500 or more locales supported. Choose your language with the character format UTF-8. Then update your system.
|
USE flags are keywords that embody support and dependency information for a certain concept. They are a core feature of Gentoo, and a good understanding of how to deal with them is needed for administering a Gentoo system.
NB: To install the software in the manner of this guide requires updating /etc/portage/package.use. By default Gentoo now creates a directory for /etc/portage/package.use/, /etc/portage/package.accept_keywords/, and /etc/portage/package.mask/ and recommends creating a file under those directories for each package where you want to make changes from that package's defaults. IMO that is convoluted and obfuscates something that was formerly simple. Therefore, I remove those directories and use files instead, as was the original method used by Gentoo. If you have an AMD system use */* VIDEO_CARDS: amdgpu radeonsi rather than */* VIDEO_CARDS: intel. There are other options, so you could just omit the VIDEO_CARDS line and install them all now, removing what you don't need later. The USE flags in make.conf are global flags that will apply to every package. The ACCEPT_LICENSE variable is needed for some software. The GRUB_PLATFORM is for using GRUB as the boot manager; not needed for EFI stub or systemd-boot, but doesn't hurt to have it in the file.
|
Gentoo now has a binary package host. We can edit make.conf and add a host at this point. For amd64 (x86-64) and arm64 (aarch64), the Gentoo binhost includes many packages used on desktop systems.
|
The EFI stub kernel is explained in the Gentoo Handbook's bootloader section.
For my Dell XPS 15 9530 this was fairly simple. The sys-kernel/installkernel package needs to have the efistub, systemd, uki, ukify, and urgd USE flags to generate the initramfs. For the distribution kernels we also need to create a kernel cmdline and enable kernel-bootcfg-boot-successful.service.
Install the firmware, microcode, and efibootmgr (to add an entry for an EFI stub kernel into the UEFI firmware). Then write the kernel cmdline.
|
The next step is to emerge the kernel.
|
The kernel build.log will complain about kernel-bootcfg-boot-successful not being enabled. Enable it then run the command it suggests to build the initramfs.
|
Then check that you have the UKI executable image in /efi and check that it is an EFI executable image.
|
|
I setup Gentoo to have the traditional interface naming scheme (eth0, eth1, wlan0, ...) rather than what udev, beginning with v197, calls "predictable, stable network interface names". Those always seemed the opposite to me, so I added net.ifnames=0 to the kernel command line via /etc/kernel/cmdline in that earlier step. This way I will always have eth0, eth1, and wlan0 as my interfaces.
If you want a static IP address, replace my network settings with yours in a file named /etc/systemd/network/10-wired.network:
|
If you prefer DHCP, the use the below for /etc/systemd/network/10-wired.network:
|
After writing the /etc/systemd/network/10-wired.network file run the following command to enable networking with systemd on the new system:
|
Set the root password using the passwd command.
|
Create a normal user account.
|
Get systemd ready for first boot:
|
|