The ports & packages collection does NOT go through the thorough security audit that OpenBSD follows. Although we strive to keep the quality of the packages collection high, we just do not have enough human resources to ensure the same level of robustness and security.
The port collection, originally borrowed from FreeBSD, fills this gap. The concept is to have, for each third-party software, a Makefile that controls
Packages are the binary equivalent of ports. A compiled port becomes a package that can be registered into the system using pkg_add(1).
Packages look like simple .tgz
bundles, but they should
always be added using
pkg_add(1),
as there might be some extra information that only
pkg_add(1)
knows how to handle.
Tip: you can distinguish between packages and .tgz bundles
using
pkg_info(1).
pkg_add pkgname.tgz
.
If you are grabbing packages off a single source (a package repository),
set PKG_PATH to that repository URL, in order to grab dependencies.
For instance, to install the gimp package for the 2.8 release on an i386 machine off the ftp site (including dependencies), do:
# setenv PKG_PATH ftp://ftp.openbsd.org/pub/OpenBSD/2.8/packages/i386/ # pkg_add ${PKG_PATH}gimp-1.1.27.tgz
The 2.7 release saw the introduction of a stable branch for the ports tree.
For instance, to grab the stable branch for the 2.8 release:
$ cd /usr/ports $ cvs -q -d anoncvs@some.anon.server:/cvs up -r OPENBSD_2_8 -Pd
Starting with the 2.8 release, selected binary packages are also made available. Thanks to Christian Weisgerber for handling the hard work of coordinating the stable branch changes. Please refer to the stable packages page to find out about updated packages and important updates to the stable branch.
Package names are always changed in case of a package update, to avoid any risk of confusion between a package from the release and a bug-fixed package.
As of OpenBSD 2.8, to update a package you must:
You can ftp the release version from the pub/OpenBSD/[version] (where [version] is the release number) directory on any of the ftp mirror sites. The release versions are the ones we ship on our CDROM, and have gone through more testing than any snapshot. Further information is available in the ports(7) man page.
The ports tree, like the rest of OpenBSD, is constantly changing. The normal life cycle of the ports tree is as follows:
The current ports tree may not be used with the previous release once the switch to tracking OpenBSD-current occurs. This is due to changes, typically with the port make process, that require code based upon the OpenBSD-current source tree.
The ports tree works as a single entity. Updating a single directory is
not guaranteed to work, as package dependencies may force you to update
and recompile vast portions of the ports tree.
It is strongly suggested that people don't track ports-current unless
they're prepared to deal with various problems.
Mailing lists such as
ports-changes@openbsd.org
or
tech@openbsd.org
will probably be invaluable.
A list of daily changes to ports and ports-current is available.
The ports-current tree can be retrieved via:
As of 2.9, OpenBSD ships with XFree 4.0.3.
If you are using a previous distribution, together with XFree binaries
from the XFree project, you may need to apply the patch in
/usr/ports/infrastructure/patches/patch-xfree-4.0
to a default binary XFree 4.0.x distribution for it to work with the OpenBSD
ports tree.
Let's say you managed to get a ports tree and you want to compile and install the archiving utility unzip. You should be able to do something like this:
% cd /usr/ports/archivers/unzip % su # make # make install # exitEasy, huh ? Especially considering all that happened in the background:
With OpenBSD 2.8, almost all ports automatically build packages when installing.
As ports get built, the /usr/ports/distfiles directory gets filled with program sources, and /usr/ports/packages gets filled with binary packages. Users with low connectivity may refer to mirror-distfiles(7) for an efficient way to grab all distfiles at once. In OpenBSD-current, you can use the script /usr/ports/infrastructure/fetch/clean-old to track old distfiles. Note that the OpenBSD CD only include the ports tree and selected packages. If you wish to have the distfiles, you will have to get them through an independent way.
If you are interested in helping to expand the OpenBSD ports tree you should first read porting.html. That page references the FreeBSD Porter's Handbook as well as OpenBSD specific policies and hints.
If you have trouble with existing ports, or need information about creating new ports, please send e-mail to the OpenBSD ports mailing list, ports@openbsd.org. Corrections are always welcome, but in any case do please provide:
uname -a
,