Moving from OpenBSD 3.8-Release to -Stable
I just upgraded jane to OpenBSD 3.8-Release, and now I need to install the ports collection, then update to the -stable code line.
Recall that OpenBSD is released in a number of OpenBSD flavors. Release is the major versions released on CD-ROM and for download. When you install from a CD or the web, you’re usually installing -Release. Stable is Release plus important security and functionality fixes. Current is the latest code.
I usually move up from Release to Stable, not so much for the updates to the kernel and userland code, but so I can follow the latest ports tree. Unfortunately, this involves a series of painful steps:
- Download the -Release ports tree and extract it to
/usr/ports.The
ports.tar.gztarball contains theportsdirectory, so it should gettar xzfd in/usr/. - Download the -Release kernel and userland sources, and extract it to
/usr/srcThe
src.tar.gzandsys.tar.gzsource tarballs do not contain thesrcdirectory, so they should gettar xzfd in/usr/src. I always forget this, and end up spewing source files all across/usras a result. - Get the -Stable ports, kernel, and userland sources from CVS (getting the -Release stuff first makes this alot faster)
Upgrading to -stable from -release is pretty straightforward; the following commands from the OpenBSD faq section on building the system from source are pretty simple:
# cd /usr # export CVSROOT=anoncvs@anoncvs.example.org:/cvs # cvs -d$CVSROOT checkout -rOPENBSD_3_8 -P srcIn my case, my server is in the central US, so instead of
anoncvs.example.orgI useanoncvs3.usa.openbsd.orgfrom the AnonCVS server list.You repeat the
cvscommand forsrcandportsboth. - Build the -Release kernel and userland binaries
For my purposes the standard,
GENERICkernel is fine. From the same ‘building the system from source‘ faq section as above, the following build commands are provided:# cd /usr/src/sys/arch/i386/conf # config GENERIC # cd ../compile/GENERIC # make clean && make depend && make [...lots of output...] # make installThis takes so long you’ll swear it’ll never finish, but eventually it does. It took about 45 minutes on
jane. Don’t forget to reboot afterwards, and before you build userland.Next, build userland:
# rm -rf /usr/obj/* # cd /usr/src # make obj # cd /usr/src/etc && env DESTDIR=/ make distrib-dirs # cd /usr/src # make buildThat last step,
make build, really takes forever. I’d estimate it ran for about 10 hours onjane. Once it’s done, reboot and you’ll have 3.8-stable userland. - Rebuild any ports that have been updated.
There are a few utilities that help out with this process, but nothing as easy as FreeBSD provides.
In
/usr/ports/infrastructure/build, there’sout-of-date, which shows a list of installed packages/ports and the ports versions which are newer. This won’t actually do the upgrade for you, but it points you in the right direction. I like to do amake uninstallfollowed by amake reinstallto upgrade ports. - Keep up to date
The -stable
portstree changes frequently, while the -stable kernel and userland sources only change when critical fixes are released. Regardless of the frequency, it’s important to keep them up to date. Once you’ve done thecvs checkoutsteps above, updating from CVS is much easier:# cd /usr/src # export CVSROOT=anoncvs@anoncvs.example.org:/cvs # cvs -d$CVSROOT up -PdObviously replacing
anoncvs.example.orgwith a real CVS server. Do this once in/usr/srcand again in/usr/portsto make sure you have the latest both.It’s not supposed to be easy. If you want easy, run Fedora Core or Windows.
This most painful part of all this is that the builds take anywhere between aeons and an eternity, depending upon the hardware.