OpenBSD System Updates - Beginner Guide

OpenBSD System Updates - Beginner Guide

Keeping your OpenBSD system updated is crucial for security and stability. Here's how to do it.

Why Updates Matter

Security patches: OpenBSD releases security fixes regularly.
Bug fixes: Regular updates fix software bugs and improve stability.
New features: Updates often include new software versions and features.

Important: OpenBSD is famous for its security focus, so keeping it updated is one of the most important things you can do.

Step 1: Check Current System State

Before updating, check what version you have and what's installed:

Check OpenBSD version:
uname -r - shows kernel release (e.g., 7.4)

List installed packages:
pkg_info - shows all installed packages (long list)
pkg_info -E - shows packages with versions (good for seeing what needs updating)

List system daemons/status:
rcctl status - shows status of services like sshd, apache, etc.

Step 2: Update the Base System (syspatch)

OpenBSD has a special update tool called syspatch for security patches.

To check for available patches:
syspatch list - shows available security patches

To apply patches:
syspatch - apply all available patches interactively
syspatch -a - apply all patches without asking

What syspatch does: Downloads and applies only the security-related changes
to your kernel and system files. It's faster and safer than a full system rebuild.

Example output:
Looking for patches...\n Checking for patches related to your kernel configuration.\n The following patches will be applied:\n - kern/printf\n - net/socket\n Applying kern/printf... Done.\n Applying net/socket... Done.\n All patches applied successfully.

Step 2: Update Installed Packages

After updating the base system, update your installed packages:

pkg_add -u - update all installed packages to latest versions

What this does: Downloads newer versions of all your installed packages and replaces them.

You'll see output like:
The following 5 packages will be updated:\n nano-6.4 -> nano-6.5\n firefox-102.0 -> firefox-103.0\n etc.

Confirm the update: Type yes when prompted, or use pkg_add -u -f to force without confirmation.

Step 3: Verify Everything Works

After updating, verify your system is still functioning:

Check kernel version: uname -r - should show the latest version

Check services: rcctl status sshd - ensure SSH still works

Check packages: pkg_info -E - verify all packages have latest versions

Test critical functions: Try SSH, web server, and other services you use.

If something broke: OpenBSD's update system is generally very reliable, but if you encounter issues:
syspatch -r - reverse/rollback recent patches (if available)
pkg_info - check what was updated

Important: Always test updates on a non-critical system first, or ensure you have a backup before updating production servers.

Ready for more system administration? Proceed to Lesson 8: Update System.

Article author: Arthur Isaev