Linux·7 min read·

Gentoo and Source-Based Distros: When Compiling Everything Is Worth It

What USE flags and source-based installs actually buy you on Gentoo, when compiling everything pays off on a VPS, and when a binary distro is the better bet.

NB

Netbay Developer Relations

Netbay Engineering

On this page

Gentoo is the distribution people mean when they say you compile everything, though that stopped being literally true years ago. Portage, its package manager, builds from source with per-package feature switches and now also consumes prebuilt binary packages. It sits at one end of a spectrum that starts at binary distros and ends at Linux From Scratch. The real question for a VPS admin is not whether compiling is possible; it is when that level of control is worth the time. This post is the cost-benefit accounting. The short version: the control is real, the time cost is real, and modern tooling lets you pay for exactly as much of each as you need.

What USE Flags Actually Buy

Every Gentoo package build is driven by USE flags: global defaults in make.conf, per-package overrides under /etc/portage. A flag turns a feature and its entire dependency tree on or off at build time. nginx without the modules you never use, OpenRC instead of systemd, curl built without Kerberos: each flag you drop is a dependency you never build, never configure, and never patch. That is the core argument for source-based systems, and it is about control, not nostalgia.

ini
# /etc/portage/make.conf — a deliberately small USE set for a VPS
USE="-systemd -wayland -gtk acl pam ssl"
MAKEOPTS="-j2"
BINPKG_FORMAT="gpkg"

The Daily Workflow

Portage's daily verbs look alarming and are honest: sync the tree, rebuild what changed including reverse dependencies, clean up. The --newuse flag catches packages whose flags changed since the last merge.

bash
emaint sync -a
emerge --ask --update --deep --newuse @world
emerge --ask @preserved-rebuild
emerge --ask --depclean

On a two-vCPU VPS a world update is measured in tens of minutes to hours, not seconds. Plan the maintenance window around it. The first world rebuild on a small VPS is a rite of passage: start it, read the output, go to lunch. Or let a binary host absorb the cost instead. If you have never read emerge output, it is unusually good: the merge plan, the USE flag changes, and the warnings all appear before you confirm anything.

Two paths to an installed package on Gentoo source path ebuild + USE flags configure compile (cc) merge into / minutes to hours binary path binhost package verify + unpack merge into / seconds to minutes

Binary Packages: The Escape Hatch

Modern Portage can produce and consume binary packages, which changes the economics entirely. Compile once on a build box, distribute the packages everywhere. A single beefy builder can serve a small fleet, and a VPS can pull prebuilt packages for everything except the handful where custom flags actually matter. For fleets, this is the difference between Gentoo being a curiosity and being an option.

bash
# Consume prebuilt binaries where available, compile the rest
emerge --ask --getbinpkg --update --deep --newuse @world

# Preview a package's USE flags and build plan before committing
emerge --pretend --verbose nginx

When Compiling Pays Off

Four situations where the source model genuinely earns its time cost:

  • Fixed-purpose appliances: a VPN box or monitoring node with a tiny, exactly-shaped package set.
  • Hardening requirements: control over flags and features that binary distros do not expose.
  • Old or unusual hardware: build exactly what the machine needs, nothing else.
  • Stability through pinning: a base built once and rebuilt rarely, with every change reviewed in emerge output.
  • Deep learning value: no distro teaches you how a Linux system fits together faster.

When It Does Not

App servers whose actual application updates weekly get little from a source-based base system, because the base is not the thing that churns. Teams without spare hours pay for every world rebuild twice: once in wall-clock time and once in attention. CI pipelines that build disposable environments feel the compile time in every single run, which is why Gentoo container images lean heavily on prebuilt stages. There is no shame in this conclusion; source-based is a tool, not a moral position.

Takeaway

Gentoo is worth it when the shape of the system is the product, meaning appliances, hardened boxes, and teaching machines, and worth it less as the churn moves to the application layer. Use binary packages to keep the option affordable.

Want to feel the difference yourself? A Netbay Linux VPS deploys in under 60 seconds, with the CPU and SSD storage that make a test world build tolerable — netbayhosts.in.

Keep reading

Follow along on a real VPS

Deploy Linux in under 60 seconds

These guides are written against Ubuntu, Debian, and RHEL-family images — the same ones on NetBay.

Deploy an instance