On this page
- What kinds of FreeBSD updates are there?
- How do I check what I am running?
- How do I apply security patches first?
- How do I create a boot environment to roll back to?
- How do I upgrade to a new minor release?
- What changes for a major version upgrade?
- How do I check that everything works?
- How do I roll back a failed upgrade?
- How do I keep the system tidy afterwards?
- Questions
What kinds of FreeBSD updates are there?
FreeBSD separates the base system (kernel plus userland tools from the project) from third party packages installed with pkg. Each has its own update path, and a release upgrade touches both.
- Patch level: security and errata fixes for your current release, for example 14.2-RELEASE-p1 to p3. Apply them with
freebsd-update fetch install. - Minor release: 14.2 to 14.3. New drivers and features, same ABI, so packages keep working without a rebuild.
- Major release: 14.x to 15.0. The ABI changes, so every package must be reinstalled for the new branch.
Each minor release is supported for only a few months after the next one appears, so plan to move along the 14 branch regularly. Check the support dates on the project security page before you start. The FreeBSD 14 image is the starting point for this guide.
How do I check what I am running?
Log in and become root with su - (or use sudo or doas if you installed one), then look at the versions:
freebsd-version -kru
uname -a
pkg -v
zfs list 2>/dev/null | head -n 3
bectl list 2>/dev/nullfreebsd-version -kru prints the installed kernel, the running kernel and the userland version. After a finished upgrade all three match. If zfs list shows a pool such as zroot and bectl list prints boot environments, the root is on ZFS and you get easy rollback. On UFS the command prints an error, and your safety net is a backup instead.
How do I apply security patches first?
Always patch the current release before jumping to the next one, and bring packages up to date too:
freebsd-update fetch
freebsd-update install
pkg update && pkg upgrade
pkg audit -Ffetch downloads and shows the files that will change, and install applies them. If a kernel file was in the list, reboot with shutdown -r now. pkg audit -F downloads the vulnerability database and lists installed packages with known issues. A clean, fully patched system gives the upgrade the best chance to apply without conflicts.
How do I create a boot environment to roll back to?
On ZFS, a boot environment is a cheap clone of the root dataset. Make one with a clear name before you change anything:
bectl create pre-14-3
bectl listThe new environment appears with no flags, while the active one carries NR (active now and on reboot). It uses almost no space at first and grows only as files change. Recent versions of freebsd-update can also create one automatically when the CreateBootEnv option in /etc/freebsd-update.conf is set to yes, but a named environment is easier to find later.
Boot environments cover the base system and anything on the root dataset. Data in separate datasets such as zroot/usr/home stays shared, so keep the daily backups add-on or your own copy for important data. On UFS, a backup is your only fallback.
How do I upgrade to a new minor release?
Name the target release with -r. Here the server moves to 14.3-RELEASE; replace it with the release you need:
freebsd-update -r 14.3-RELEASE upgradeThe tool downloads the new files, compares your changed configuration files with the new defaults and opens an editor when it cannot merge one by itself. Remove the conflict markers, keep your own settings and save. Pay attention to /etc/ssh/sshd_config and /etc/rc.conf; a broken SSH configuration is the main way to lose access. When the summary ends, install the new kernel and reboot:
freebsd-update install
shutdown -r nowLog in again and install the new userland:
freebsd-update install
freebsd-version -kruFor a minor upgrade the packages keep working, so a normal pkg upgrade afterwards is enough.
What changes for a major version upgrade?
The first steps are the same, with the major release as the target, for example freebsd-update -r 15.0-RELEASE upgrade, then install, reboot and install again. At this point the tool reminds you that old shared libraries remain until packages are rebuilt. Reinstall every package for the new ABI, starting with pkg itself:
pkg-static install -f pkg
pkg upgrade -f
freebsd-update installThe final install removes the old libraries. Reboot once more so every service starts from the new binaries. Read the release notes and the errata page before a major jump: FreeBSD 15 also introduces an optional package based base system (pkgbase), and the release announcement explains which update method is supported for systems installed from the classic images. Ports you built yourself must be rebuilt from source.
How do I check that everything works?
After the last reboot, confirm the versions and look for failed services:
freebsd-version -kru
service -e
sockstat -4 -6 -l
pkg check -d -a
tail -n 50 /var/log/messagesservice -e lists enabled services, and sockstat -l shows which ports are listening, so you can compare with what you expect: SSH, your web server, a database. If you use the pf firewall, run pfctl -sr to confirm the rules loaded. Test your applications from outside, for example with curl -I https://example.net.
How do I roll back a failed upgrade?
Before the second install step, freebsd-update rollback undoes the last installed set. Once you are further along, the boot environment is the cleaner way back on ZFS:
bectl activate pre-14-3
shutdown -r nowThe server boots into the old environment with the previous kernel, userland and packages. Destroy the failed environment later with bectl destroy. There is no browser console, so you can only switch environments from a running system over SSH. That is why the sshd configuration merge deserves care, and why a backup or a reinstall is the last resort if the server never comes back on the network.
How do I keep the system tidy afterwards?
Once you are happy with the new release, remove old boot environments to free space and keep the list short:
bectl list
bectl destroy pre-14-3
pkg autoremove
pkg clean -aThen return to the regular patch routine: freebsd-update fetch install and pkg upgrade every week or two. You can also add freebsd-update cron to root crontab so patches are downloaded in the background and mailed for review. For the Linux side of the library, compare upgrading Ubuntu and upgrading Debian.
Questions about Upgrade FreeBSD to a new release
Can I skip a minor release?
Yes. freebsd-update can move from any supported release to a newer one on the same branch, for example 14.1 to 14.3, as long as your current release is still supported.
Do I need to rebuild packages after a minor upgrade?
No. Minor releases keep the same ABI, so a normal pkg upgrade is enough. Only a major version jump needs pkg upgrade -f.
How long does an upgrade take?
Downloading and merging take a few minutes on a small server, plus two or three reboots. Allow an hour of maintenance time for a major release with many packages.
Should I run zpool upgrade after the release upgrade?
Not right away. New pool features can make the pool unreadable for an older boot loader. Wait until the new release has run well, and update the boot loader first if the release notes say so.
What if freebsd-update says my release is not supported?
The update servers stop serving end of life releases. Upgrade as soon as possible to a supported release with the -r option, or reinstall from the current image.
More in Server basics
- Create a sudo user
- Add a swap file
- Change the hostname
- Time zone and time sync
- File and directory permissions
- Choose a Linux distribution
- Upgrade Ubuntu to the next LTS
- Upgrade Debian to a new major release
- Rocky or AlmaLinux to a new major version
- Automatic security updates
- Run an app as a systemd service
- Schedule jobs with cron and systemd timers
- Environment variables on Linux
- Check disk space and find what fills it
- Inspect processes and memory
- Read the hardware and system report
- Reboot and shut down safely
- Customise the login message (MOTD)
- Remote desktop with Xfce and xrdp
- SELinux on Rocky Linux and AlmaLinux
- Keep sessions alive with tmux
- SFTP-only users in a chroot
- apt and dnf package management
- First-hour checklist for a new server