Compressing Directories on *Nix
Compressing directories, to save space, archive or backup is part of regular admin on a working server. Here is a quick and easy reference for compressing a directory using Tar and GZ, standard tools on all *nix based operating systems
To compress a directory on OpenBSD using tar and gzip, use the command:
tar -czvf archive_name.tar.gz /path/to/directory
This will create a compressed archive named archive_name.tar.gz containing the specified directory.
Patching and upgrading OpenBSD
Patching and upgrading OpenBSD can be broken down into three core componants.
- Patching the Base system install
- Patching installed packages (Applications)
- Upgrading the current version to the latest RELEASE candidate
OpenBSD has a key distinction between Linux in as much as the base system is completley seperate from installed packages. The two are kept isolated rather than integrated as is the case with Linux varients. This allows far more control over what you patch and when.
Patching the current installed base system
Patching the base system is simple a case of using the syspatch commands as shown below:
running the following command doas syspatch -c Will show a list of all available patches
Running the following command will update the base system with any new patches doas syspatch
If you get a message like Relinking to create new Kernel... Done, Reboot to load the new kernel simply run the following command: doas reboot
Upgrade installed packages(applications)
doas pkg_add -u
Upgrading To The Latest Release
To upgrade to the latest OpenBSD RELEASE candiate, first backup your system and then run the following command: doas sysupgrade/
Once this has been complete run doas sysmerge Complete any instructions to remove any old files that could not be merged during the upgrade. Once this is complete run doas pkg_add-u this will upgrade all installed packages to align to the OpenBSD version you have updated to. Once this is complete run doas syspatch this will apply any subsequent package updates to align to the latest RELEASE version installed.
NOTE: You can only upgrade one version step at a time for example version 7.6 to version 7.7.
If the current RELEASE version is 7.9 for example and your current version is 7.7 you will need to upgrade to version 7.8 first.
To do this you will need to specify a specific release when using the sysupgrade command.
In our example here where you are currently running version 7.7 and need to upgrade to version 7.8 first you can specify this version in the sysupgrade command as follows:
sysupgrade -R 7.8
Once this upgrade has been completed and you carry out the sysmerge, pkg_add -u and syspatch commands to complete interim upgrade
Once the interim upgrage has been completed you can upgrade as normal without specifying the RELEASE number
doas sysupgrade
This will then upgrade to the latest RELEASE version. Once complete carry out the same doas sysmerge, doas pkg_add -u and doas syspatch commands as detailed above.
For reference the lastest version of OPENBSD is 7.9. Version 8 will likely be release in Nov/Dec 2026