Gentoo (also Gentoo Linux) is a source-based Linux distribution in which the package manager normally compiles software from source code on the user’s machine according to locally chosen options. Among the fundamentals of Linux, it is the standard example of a distribution that trades installation speed for maximum configurability and transparency.
Gentoo follows a rolling release model, so there are no numbered major versions to upgrade between. Its central tool, Portage, reads build recipes called ebuilds and combines them with system-wide and per-package settings to produce binaries tailored to the hardware and the administrator’s preferences.
How Portage builds software from source
Portage builds software by resolving dependencies, downloading upstream source archives, applying patches and compiling them according to ebuild instructions and local configuration. The command-line front end is emerge, and the collection of ebuilds is the Gentoo repository, synchronized locally and historically called the Portage tree.
Each ebuild is a Bash script with standardized phases such as fetching, unpacking, configuring, compiling and installing. Portage first installs files into a temporary image directory and then merges them into the live system, recording every file so that packages can be cleanly removed or upgraded later.
Ebuilds carry keywords that describe their status on each architecture. A keyword such as amd64 marks a version as stable on that platform, while ~amd64 marks it as testing. Most systems run stable keywords and accept testing versions only for selected packages, which keeps the rolling system predictable while still allowing newer software where it is needed.
The table below lists the configuration elements that shape every build.
| Element | Location | What it controls |
|---|---|---|
| make.conf | /etc/portage/make.conf | Compiler flags, global USE flags, parallel jobs |
| USE flags | make.conf and package.use | Optional features and dependencies per package |
| Profile | /etc/portage/make.profile | Baseline defaults for a system type |
| package.accept_keywords | /etc/portage/ | Use of testing versions for chosen packages |
| World file | /var/lib/portage/world | Packages explicitly requested by the administrator |
USE flags and system customization
USE flags are named switches that enable or disable optional features of a package at build time, and they are Gentoo’s most distinctive concept. A flag such as wayland, pulseaudio or ssl decides whether support for that feature is compiled in, which in turn decides which dependencies are pulled in.
Flags can be set globally for the whole system or per package, and profiles provide sensible defaults for desktop, server or hardened systems. The result is a system that contains only the code paths the administrator actually wants, which reduces disk usage and can shrink the attack surface.
Gentoo also offers unusual freedom in core components. Administrators can choose OpenRC or systemd as the init system, the glibc or musl C library, and among several kernel source packages, including distribution kernels that are built and configured automatically.
The following table shows common profile families and their typical use.
| Profile family | Typical use | Notable defaults |
|---|---|---|
| Default (base) | Minimal servers and custom builds | Few USE flags enabled |
| Desktop | Workstations with a graphical session | Audio, graphics and desktop flags |
| Hardened | Security-sensitive systems | Stack protection and hardened toolchain |
| systemd variants | Systems standardized on systemd | systemd instead of OpenRC |
| musl variants | Small or embedded environments | musl C library instead of glibc |
Gentoo compared with other distributions
Gentoo differs from most distributions because its default unit of delivery is source code, not a prebuilt binary package. Other distributions in the Linux fundamentals neighborhood make different trade-offs between control, effort and stability.
| Distribution | Package format | Release model | Main strength |
|---|---|---|---|
| Gentoo | Source ebuilds, optional binaries | Rolling | Build-time customization |
| Arch Linux | Binary packages via pacman | Rolling | Simplicity and current software |
| Debian | Binary .deb packages | Fixed stable releases | Stability and broad support |
| NixOS | Declarative Nix derivations | Channels and releases | Reproducible configurations |
| Slackware | Binary tarballs | Fixed releases | Minimal, traditional design |
Gentoo has historically influenced other projects. ChromeOS and ChromiumOS use Portage as their build system, which shows that the tooling scales to producing reproducible images for large fleets of devices.
Installation and maintenance in practice
Gentoo is installed manually by following the Gentoo Handbook, which guides the user through partitioning, unpacking a stage 3 archive, configuring Portage, building a kernel and installing a bootloader. A stage 3 archive is a minimal prebuilt base system from which everything else is compiled.
Routine maintenance means syncing the repository and updating the world set, usually with emerge --sync followed by emerge -avuDN @world. Since late 2023, the project also provides official binary package hosts for common architectures, so many packages can be installed precompiled while others are still built locally.
The decision table below summarizes when Gentoo is a sensible choice.
| Situation | Recommendation | Reason |
|---|---|---|
| Learning how Linux is assembled | Gentoo is well suited | Every layer is configured explicitly |
| Specialized or embedded hardware | Gentoo or a custom build | Fine control over features and toolchain |
| Production servers needing vendor support | Choose an enterprise distribution | Certified support and fixed lifecycles |
| Laptop with limited time for upkeep | Use binary packages or another distribution | Compiling large software is slow |
Limitations and common misconceptions
The most persistent misconception is that Gentoo is dramatically faster because of compiler optimization. In practice, aggressive CFLAGS usually bring small or unmeasurable gains for typical workloads and can introduce hard-to-debug failures. The real benefits are feature selection, transparency and control.
- Long build times: large packages such as web browsers, compilers and office suites can take hours on modest hardware.
- Maintenance discipline: infrequent updates make dependency conflicts and news items easy to miss, so regular updates are safer.
- Configuration drift: many per-package USE flag changes make systems hard to reproduce without careful documentation.
- Smaller user base than major binary distributions, so commercial software vendors rarely test against it.
A non-technical view
Most Linux systems are like buying furniture already assembled. Gentoo is more like getting the plans and the raw wood. You decide which drawers, handles and finishes you want, and the system builds each piece for you.
This takes longer and needs more care. In return, you get exactly what you asked for and know how it was made. People choose it to learn, to control every detail, or to fit unusual hardware.
A concrete example
A small company builds network appliances on low-power x86 boards with 4 GB of memory. The engineers maintain a Gentoo build host that compiles all packages with a hardened profile and a minimal set of USE flags, removing graphical libraries, printing support and unused protocols.
The build host publishes binary packages for the whole fleet, so individual appliances never compile anything themselves. The final image is under 600 MB, contains only the required services, and each security update is rebuilt once centrally and rolled out to every device within a day.