Updating OpenBSD and NetBSD.
This tutorial is about updating OpenBSD 7.0 and NetBSD 9.2. Not sure, how far it applies to older or newer releases of these two operating systems.
Updating OpenBSD.
There are no regular updates for a specific OpenBSD release. However, sometimes when a critical bug is found, updates are released as so-called binary patches.
For supported versions of OpenBSD, the easiest way to get the latest security patches is to use the syspatch utility.
To retrieve a list of available patches, use the command
syspatch -c
To apply all available patches, run the command
syspatch
![]() |
In order to update packages outside of Base, installing the new packages available in the ports collection, you can use the pkg_add tool.
To update all packages that have a newer version in ports, run the command
pkg_add -uvi
where -v stands for "verbose", and -i stands for "interactive".
When running this command on my OpenBSD 7.0, I got the error message: no such dir. This means that the URL, from where OpenBSD tries to retrieve the updates does not exist.
The repository URL can be found in the file /etc/installurl. Open this file using the vi editor. I set the URL to "https://ftp.eu.openbsd.org/pub/OpenBSD".
![]() |
Now, pkg_add runs without errors. As far as I understand, the output shown on the screenshot below means that there are no updates available.
![]() |
Note: To add a new package, use the command:
pkg_add -u <package-name>
Updating NetBSD.
Concerning NetBSD, there are no security patched files kept in a special place or anything like that. It is supposed that you always install the latest subversion: NetBSD 9.3 can be thought of as a security patched version 9.2.
There are several ways to update NetBSD packages. The recommended way to manage your system with binary packages is to use pkgtools/pkgin.
To use pkgin, you have first to install it:
pkg_add -v pkgin
Trying to do so on my NetBSD 9.2 resulted in the error message: no pkg found for 'pkgin', sorry.
The reason for this error is that no URL, from where to retrieve the package, is set. You can do this, by running the command:
export PKG_PATH="http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/9.2/All/"
Now, you can run pkg_add. The screenshot shows the last screen of the program output.
![]() |
Before you can use pkgin, you'll have to configure the binary repository from which you want to install packages in the file /usr/pkg/etc/pkgin/repositories.conf.
I opened this file using the vi editor. The URL indicated was: https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/$arch/9.0/All. I'm not sure if this is correct to do, but as I'm using NetBSD 9.2. I changed "9.0" to "9.2" (?).
Running pkgin failed (as well as when using "9.2", as when using "9.0"), the error message displayed telling that there has been an authentication error.
![]() |
I did not make the effort to understand what's this about. It seems to be some problem with HTTPS, possibly specific for NetBSD 9 (?). A simple work-around of the issue is to use HTTP instead. So, edit the configuration file and delete the "s" of "https".
![]() |
Now, running pkgin should succeed. Commands to update all packages:
pkgin update
pkgin upgrade
![]() |
On my system, it seemed that all packages are up to date...
Note: To add a new package, use the pkgin install command. For example, to install the text editor
nano, run the command:
pkgin install nano
If you find this text helpful, please, support me and this website by signing my guestbook.