Installing Packages
Before beginning, please read about [[https://www.openbsd.org/faq/faq15.html|OpenBSD's package system from the FAQ]].
Installation
To install a package (like nvi):
$ doas pkg_add nvi
Deletion
To delete a package:
$ doas pkg_delete nvi
To delete orphan packages (unused dependencies of packages that have been removed before):
$ doas pkg_delete -a
Package Metadata
To find a package from repositories:
$ pkg_info -Q nvi
To show package contents:
$ pkg_info -L nvi
To learn more about a package:
$ pkg_info nvi
Troubleshooting
/etc/installurl
You may encounter this error:
$ doas pkg_add package https://cdn.openbsd.org/pub/OpenBSD/7.7/packages-stable/amd64/: ftp: cdn.openbsd.org: no address associated with name https://cdn.openbsd.org/pub/OpenBSD/7.7/packages/amd64/: ftp: cdn.openbsd.org: no address associated with name https://cdn.openbsd.org/pub/OpenBSD/7.7/packages/amd64/: empty Can't find package
The error above indicates that your system can't resolve the name
cdn.openbsd.org
. This could be due to a misconfiguration of your
local nameservers, or it could be due to an issue with a
mirror's DNS records.
If the issue is your local nameservers, you may want to configure unbound.
To change the mirror, edit /etc/installurl
to use a different mirror from
the list of OpenBSD mirrors.