skip to content

FreeBSD

FreeBSD ships kernel and userland as one coherent base system, with ports and pkg for software, jails for isolation, and first-class ZFS. Expect comparisons with Linux: jails versus containers, and a curated base system versus a distribution assembled from parts.

on this pageshow

questions

6

FreeBSD is described as shipping a "base system" rather than being assembled like a Linux distribution. What does that mean concretely on a running machine, and how does it change the way you patch and upgrade it?

level: middleimportance: must knowfreq 70%

answer

  1. one source tree, one release
  2. base under /, ports under /usr/local
  3. two updaters, two version numbers
  4. /etc is base, /usr/local/etc is yours
  5. coherence bought with coarse granularity

basics

~10 s

FreeBSD's kernel and core userland are built from one source tree and released, patched and upgraded as a single versioned unit, while every third-party program installs separately under /usr/local and is managed by pkg.

solid answer

~50 s

On FreeBSD the kernel, libc, the shell, the standard utilities, the compiler, OpenSSH, `pf`, `bhyve`, DTrace, ZFS and jails all come out of one `src` repository and ship as one versioned release. The install draws a hard line on disk: base owns `/bin`, `/sbin`, `/usr/bin`, `/lib` and `/etc`, while everything you add installs under `/usr/local`, with its configuration in `/usr/local/etc` and its startup scripts in `/usr/local/etc/rc.d`. That gives you two independent update paths — `freebsd-update fetch install` (or a source `buildworld`/`installworld`) for base, `pkg upgrade` for the rest — and two version numbers, reported by `freebsd-version` and `pkg info`. The win is coherence: the man pages match the binaries and the userland is tested as one unit. The cost is granularity — you cannot move one base library ahead of its branch, and each base upgrade makes you merge your local `/etc` edits against the new base `/etc`.

code

bash · 11 lines
bash
# Base: installed kernel, running kernel, and userland versions
freebsd-version -k
freebsd-version -r
freebsd-version -u

# Base: binary security/errata patches (RELEASE branches)
freebsd-update fetch install

# Third-party software, all of it under /usr/local
pkg upgrade
pkg audit -F

go deeper

for a junior

Know the disk split: base tools live in /bin, /sbin and /usr/bin with config in /etc, and anything you install lives under /usr/local with config in /usr/local/etc. Say that pkg only manages the second half.

for a middle

Be ready to explain that kernel and userland come from one src tree and ship as one release, and to name both update paths — freebsd-update for base, pkg upgrade for third-party software — plus why the two carry separate version numbers.

for a senior

Show you can plan a real upgrade: base patches versus package upgrades, the /etc merge step, the reboot needed for a new kernel, and what you do when a base component needs a fix the branch has not shipped yet.

for a principal

Own the trade-off argument. A single tested userland gives fleet-wide predictability and a clean jail story; it also means coarse patch granularity and a smaller vendor ecosystem, and you should be able to say which of those matters more for the systems you run.

## What "base system" actually means FreeBSD is a single project that develops a kernel *and* a userland in one source repository (conventionally checked out at `/usr/src`). A release such as 14.1-RELEASE is a snapshot of that whole tree: the kernel, libc, `/bin/sh`, `ls`, `ps`, `sed`, the C compiler (Clang/LLVM), OpenSSH, the `pf` and `ipfw` firewalls, the `bhyve` hypervisor, DTrace, ZFS, the jail subsystem, and the manual pages that document all of it. Nobody "assembles" FreeBSD from independently-versioned upstreams the way a Linux distribution takes a kernel from one project, a libc from another, coreutils from a third and an init system from a fourth and integrates them. That difference is not philosophical trivia — it is visible on disk and it dictates your operational routine. ## Where the line is drawn on disk Base owns the traditional Unix paths: `/bin`, `/sbin`, `/lib`, `/usr/bin`, `/usr/sbin`, `/usr/lib`, its configuration in `/etc`, and its service scripts in `/etc/rc.d`. Everything third-party installs beneath `/usr/local`: binaries in `/usr/local/bin`, configuration in `/usr/local/etc`, service scripts in `/usr/local/etc/rc.d`. So an nginx installed with `pkg` reads `/usr/local/etc/nginx/nginx.conf`, not `/etc/nginx/nginx.conf`, and is started by an rc script in `/usr/local/etc/rc.d/nginx` enabled with a line in `/etc/rc.conf`. If you deleted `/usr/local` you would remove every package you ever installed and still have a bootable, fully functional operating system with a compiler and an SSH server. On a typical Linux distribution the package manager owns nearly everything under `/`, including the shell and coreutils, so no such line exists. ## Two update paths, two version numbers Because base and packages are separate, they update separately: ```sh # base: binary security/errata patches on a RELEASE branch freebsd-update fetch install # base: the from-source path make -C /usr/src buildworld buildkernel make -C /usr/src installkernel etcupdate -p && make -C /usr/src installworld && etcupdate -B # everything third-party, under /usr/local pkg upgrade ``` `freebsd-version -k` reports the installed kernel version, `-r` the running kernel and `-u` the userland — they can legitimately disagree between an update and the reboot that lands it. `pkg info` reports package versions, which follow their own upstreams and have nothing to do with the base number. ## What the model buys you **Coherence.** The kernel, the libraries and the tools were built and tested together, so ABI mismatches inside base do not happen, and the man page on the machine describes the binary on the machine. Kernel interfaces (KBI) stay stable within a major branch, so a module built for 14.0 loads on 14.1. **Predictability.** Any FreeBSD 14.1 host is the same host everywhere; the only variance is what you installed on top. That makes fleet reasoning, imaging and jail creation simple — a jail root is literally an extracted `base.txz` from a release. **One advisory stream.** Base problems arrive as project Security Advisories and Errata Notices covering the whole base; package problems are reported separately by `pkg audit`. ## What it costs you **You cannot cherry-pick base components.** If the OpenSSH in base needs a fix, you wait for the base patch (or install the `openssh-portable` port and disable the base daemon) — you cannot `pkg upgrade` it, because it is not a package. Base moves as a unit, on its branch's schedule. **Configuration merges.** `/etc` is shared: base ships defaults there and you edit the same files. Every base upgrade therefore includes a merge step (`etcupdate`, historically `mergemaster`) that reconciles your edits with the new base `/etc`. Package upgrades avoid this because their config lives under `/usr/local/etc` and packaged defaults are usually installed as `*.sample` files. **A smaller ecosystem.** One project maintaining a whole OS means fewer hands, and third-party vendors ship for Linux first. ## Interview framing The question is really testing whether you can operate a machine you did not build. A strong answer names the disk split, names the two upgrade commands, and then volunteers the trade-off honestly: coherence and predictability in exchange for coarse-grained patching plus an `/etc` merge on every upgrade.

  • A CVE lands in a library that base ships. Why can't you just run pkg upgrade to fix it?
    Because that library is not a package — it was built from the `src` tree and installed under `/usr/lib` as part of base, so `pkg` has no record of it. The fix arrives as a base errata or security patch applied with `freebsd-update fetch install` (or a source rebuild). The alternative is to install a port that provides its own copy under `/usr/local` and make the affected consumers link against that instead.
  • Why does a FreeBSD base upgrade include a configuration merge step that package upgrades don't?
    Because `/etc` holds files that base owns *and* that you edit — `rc.conf`, `sysctl.conf`, `master.passwd`, `ssh` config. A new base ships new defaults for the same paths, so `etcupdate` (previously `mergemaster`) three-way-merges your changes against them. Packages sidestep the problem: their files live under `/usr/local/etc` and defaults usually arrive as `.sample` files that never overwrite the live copy.
  • How does the base-system split make creating a jail simpler than building a container image?
    A jail root is just a directory containing an extracted base userland — the `base.txz` distribution file from a release, or a ZFS clone of one. There is no image format, no layering and no build tool involved, because the userland is already a single coherent tarball the project ships. You then add packages under that root's `/usr/local` exactly as you would on the host.

saying these in an interview costs you the question

  • Thinks pkg manages the kernel and libc too
  • Looks for package configuration in /etc, not /usr/local/etc
  • Assumes freebsd-update also upgrades installed packages
  • Claims base components can be upgraded individually
  • Confuses the base version with any package version

context

open as a page

What is a FreeBSD jail, and how does its isolation model differ structurally from the way Linux builds containers?

level: seniorimportance: must knowfreq 60%

basics

~20 s

A jail is one kernel object that confines a process tree to a directory root, a hostname, an address set and a restricted root user in a single step. Linux has no equivalent single object; containers there are composed from several independent kernel facilities.

open as a page

On FreeBSD, what is the difference between installing software from the ports tree and installing it with pkg, and when is building from ports actually worth the time?

level: juniorimportance: should knowfreq 72%

basics

~20 s

The ports tree is a collection of build recipes you compile from source with your own options; pkg installs prebuilt binary packages that the project produced from those same recipes using default options. Most installs should use pkg.

open as a page

Explain the difference between FreeBSD's CURRENT, STABLE and RELEASE branches, and what the trailing "-p6" in a version string such as 14.1-RELEASE-p6 tells you.

level: middleimportance: should knowfreq 42%

basics

~20 s

CURRENT is FreeBSD's main development branch, STABLE is the per-major-version branch that keeps kernel and userland interfaces compatible while taking merged changes, and RELEASE is a tagged snapshot cut from it. The -p number is the applied security and errata patch level.

open as a page

FreeBSD ships ZFS in the base system and its installer offers a root-on-ZFS layout. What does that integration let you do around upgrades that a filesystem added on afterwards does not?

level: seniorimportance: should knowfreq 46%

basics

~20 s

Because ZFS is in base and the loader can boot any root dataset, FreeBSD supports boot environments: you clone the running system before an upgrade and, if it goes wrong, activate the old clone and reboot back into the previous OS in seconds.

open as a page

Your company is building a closed-source network appliance and is choosing an operating-system base. How does FreeBSD's permissive licence change that decision compared with a Linux base, and what does choosing permissive cost you?

level: principalimportance: nice to knowfreq 32%

basics

~20 s

FreeBSD's base ships under a permissive two-clause BSD licence, so you may modify and ship it inside a closed product without publishing your changes. The costs are no reciprocity from others, a smaller driver and vendor ecosystem, and a much smaller hiring pool.

open as a page