Gentoo
Compile everything. Total control over every byte in your system.
Overview
| Based on | Independent |
| Package manager | Portage (emerge) |
| Package format | Source-based ebuilds (binary packages also available) |
| Release model | Rolling release |
| Default DE | None (you choose and compile) |
| Init system | OpenRC (default) or systemd (supported) |
| Website | gentoo.org |
Why Gentoo?
- USE flags - Fine-grained control over which features are compiled into every package. Disable what you don't need, enable what you do.
- Optimized for your hardware - Packages are compiled with your CPU's specific instruction set. CFLAGS tuned for your exact machine.
- Deep understanding - Building a Gentoo system teaches you more about Linux internals than almost any other distro
- Choice of init - Officially supports both OpenRC and systemd. One of the few major distros where you choose your init system.
- No bloat, ever - Nothing is installed unless you explicitly ask for it. Every package, every feature is a deliberate choice.
- Incredible documentation - The Gentoo Handbook is one of the best installation guides in all of Linux
Package Management
Gentoo uses Portage and the emerge command. Packages are compiled from source using ebuilds (build scripts).
# Sync the Portage tree (get latest package definitions)
sudo emerge --sync
# Install a package (compiles from source)
sudo emerge --ask www-client/firefox
# Update entire system
sudo emerge --ask --update --deep --newuse @world
# Search for a package
emerge --search "text editor"
# Or search descriptions:
emerge --searchdesc "image editor"
# Remove a package
sudo emerge --deselect www-client/firefox
sudo emerge --depclean
# Show info about a package
emerge --info www-client/firefox
# List installed packages
qlist -Iv
USE Flags
# View USE flags for a package
emerge --info www-client/firefox | grep USE
equery uses www-client/firefox
# Set global USE flags in /etc/portage/make.conf
# Example: USE="X gtk -gnome -kde pulseaudio alsa"
# Set per-package USE flags in /etc/portage/package.use/
# Example: echo "www-client/firefox hwaccel" >> /etc/portage/package.use/firefox
# After changing USE flags, rebuild affected packages
sudo emerge --ask --update --deep --newuse @world
Binary Packages
# Gentoo now supports binary packages for faster installs
# Enable binhost in /etc/portage/binrepos.conf
# Install a binary package if available
sudo emerge --ask --getbinpkg www-client/firefox
# Mix binary and source: use binaries when available, compile the rest
sudo emerge --ask --getbinpkg --update --deep @world
Time commitment: Compiling large packages like Firefox, Chromium, or LibreOffice can take hours depending on your hardware. A full system install can take a day or more. Gentoo's binary packages option can help, but expect to invest significant time regardless. This is a distro for people who enjoy the process.
make.conf Essentials
# /etc/portage/make.conf - key settings
# CPU optimization (use 'gcc -march=native -Q --help=target' to find yours)
COMMON_FLAGS="-march=native -O2 -pipe"
# Parallel compilation (number of CPU cores + 1)
MAKEOPTS="-j9"
# Global USE flags
USE="X wayland gtk -gnome -kde pulseaudio pipewire vulkan"
# Video card drivers
VIDEO_CARDS="amdgpu radeonsi"
# or VIDEO_CARDS="nvidia"
# or VIDEO_CARDS="intel"
# Accept licenses
ACCEPT_LICENSE="*"
Tips
- Follow the Gentoo Handbook step by step for your first install. Do not skip sections.
- Set MAKEOPTS to your core count to dramatically speed up compilation
- Use
ccacheto cache compilation results and speed up rebuilds - Consider distcc for distributed compilation across multiple machines
- Use Gentoo's binary packages for large packages like browsers and office suites to save time
- Read
eselect news readafter everyemerge --syncfor important update notices - Install
gentoolkit(emerge gentoolkit) for useful tools likeequery,eclean, andrevdep-rebuild - If Gentoo interests you but seems too extreme, consider Funtoo or Calculate Linux for a friendlier Gentoo-based experience