Updating OBSD to Stable with Cvsup
With Concurrent Versions System UPdate, OpenBSD users can keep their own source trees up to date.
Online you will find a lot of information on the older method of updating called CVS. CVS has given way to CVSup for updating since CVSup is more efficient for this task.
- Intro to updating - what's needed when updating
- What should you update? - what the average home user should update
- 1 of 3 - Updating and building your system and kernel - updating your system and kernel
- Compiling and installing a kernel - how to build and install an obsd kernel
- Rebuilding the system - how to rebuild with Make Build
- 2 of 3 - Updating and building your ports - checking your ports for updates
- 3 of 3 - Updating and building your Xenocara (X Window) system - rarely will you have updates for Xenocara
- When kernel building goes bad - booting into an older kernel after the new kernel has problems
Intro to Updating
If you are not a developer then updating to -stable should be your choice. The cvsup program will allow you to download the updated source files for OpenBSD. Then you will want to rebuild your system files, kernel and any ports that you already have installed to complete the update process.
What is needed to update OpenBSD
- An online connection
- The cvsup program
- Cvsup configuration files
Obtaining CVSup
The easiest way to obtain the cvsup program would be with the pkg_add remote command.
Adding the cvsup package to your server:
What needs updating?
The average home user will want to update:
- System and kernel source files
- Port system source files
- Xenocara (X Window) system source files
Information on where to download and keep source files can be found here.
1 of 3 - Updating and Building your System and Kernel
- Step 1. Create a cvsup configuration file for system and kernel sources
- Step 2. Run cvsup with the configuration file
- Step 3. Rebuild and install your kernel
- Step 4. Rebuild and install your system
1. Using your favorite text editor create a file called cvsup-file-src
# Defaults that apply to all the collections *default release=cvs *default delete use-rel-suffix *default umask=002 *default host=anoncvs3.usa.openbsd.org *default base=/usr *default prefix=/usr *default tag=OPENBSD_4_3 # If your network link is a T1 or faster, comment out the following line. # *default compress #OpenBSD-ports #OpenBSD-all OpenBSD-src #OpenBSD-www #OpenBSD-x11 #OpenBSD-xenocara
Change anoncvs3.usa.openbsd.org to a server near you and uncomment the OpenBSD-src line.
2. Updating your source tree with the cvsup-file-src file:
The source tree will be a 594 meg download the first time you run cvsup.
3. Compiling and installing a kernel
Backup the current kernel:
Next configure the kernel:
# cd /usr/src/sys/arch/i386/conf/ # config GENERIC Don't forget to run "make depend"
Finally compile and install the new kernel:
# cd ../compile/GENERIC # make clean && make depend && make && make install
Simply reboot to try out the new kernel.
4. Rebuilding the system:
# rm -rf /usr/obj/* # cd /usr/src # make obj # cd /usr/src/etc && env DESTDIR=/ make distrib-dirs # cd /usr/src # make build
Total time for make build on a 2.60GHz processor was 75 minutes.
Note: Make build does not rebuild your ports collection. To rebuild ports you will need to first check your already installed ports for any upgrades, then individually rebuild each port that needs upgrading. Further information can be found here.2 of 3 - Updating and Building your Ports
- Step 1. Create a cvsup configuration file for the ports source files
- Step 2. Run cvsup with the configuration file
- Step 3. Checking your ports with the out-of-date script
- Step 4. Updating/Rebuilding your ports
1. Using your favorite text editor create a file called cvsup-file-ports
# Defaults that apply to all the collections *default release=cvs *default delete use-rel-suffix *default umask=002 *default host=anoncvs3.usa.openbsd.org *default base=/usr *default prefix=/usr *default tag=OPENBSD_4_3 # If your network link is a T1 or faster, comment out the following line. # *default compress OpenBSD-ports #OpenBSD-all #OpenBSD-src #OpenBSD-www #OpenBSD-x11 #OpenBSD-xenocara
Change anoncvs3.usa.openbsd.org to a server near you and uncomment the OpenBSD-ports line.
2. Updating your ports tree with the cvsup-file-ports file:
The ports tree will be a 103 meg download the first time you run cvsup.
3. Checking your ports with the out-of-date script
This output shows there are no ports needing updating:
# cd /usr/ports/infrastructure/build/ # ./out-of-date Collecting installed packages Collecting port versions: complete Collecting port signatures: complete Outdated ports: #
This output shows there are ports needing updating:
# cd /usr/ports/infrastructure/build/ # ./out-of-date Collecting installed packages Collecting port versions: complete Collecting port signatures: complete Outdated ports: www/mozilla-firefox # 2.0.0.7 -> 2.0.0.12 #
The only port needing upgrading in this example is Firefox.
4. Updating/Rebuilding your ports
Locate the Firefox port directory:
Update the Firefox port to the latest release:
# cd /usr/ports/www/mozilla-firefox/ # make update
3 of 3 - Updating and Building your Xenocara (X Window) System
- Step 1. Create a cvsup configuration file for the Xenocara (X Window) system
- Step 2. Run cvsup with the configuration file
- Step 3. Rebuild the Xenocara (X Window) system
1. Using your favorite text editor create a file called cvsup-file-xenocara
# Defaults that apply to all the collections *default release=cvs *default delete use-rel-suffix *default umask=002 *default host=rt.fm *default base=/usr *default prefix=/usr *default tag=OPENBSD_4_3 # If your network link is a T1 or faster, comment out the following line. # *default compress #OpenBSD-ports #OpenBSD-all #OpenBSD-src #OpenBSD-www #OpenBSD-x11 OpenBSD-xenocara
Change rt.fm to a server near you and uncomment the OpenBSD-xenocara line.
Note: Currently not all CVSup servers offer Xenocara.2. Updating your ports tree with the cvsup-file-xenocara file:
The xenocara tree will be a 330 meg download the first time you run cvsup.
3. Rebuilding your Xenocara (X Window) system:
# rm -rf /usr/xobj/* # cd /usr/xenocara # make bootstrap # make obj # make build
Total time for make build on a 2.60GHz processor was 75 minutes.
Note: OpenBSD releases 4.1 and below required the tk and tcl packages to be installed when building the X Window system. These packages are no longer required when building Xenocara.When Kernel Building Goes Bad
If the newly installed kernel will not boot then boot into a previous bootable kernel.
When you restart the system wait until you see something similar to the below:
Using drive 0, partition 3. Loading... probing : pc0 com0 apm mem[634K 319M a20=on] disk: fd0 hd0+ >> OpenBSD/i386 BOOT 3.01 boot>
at this point boot into a previous bootable kernel:
Using drive 0, partition 3.
Loading...
probing : pc0 com0 apm mem[634K 319M a20=on]
disk: fd0 hd0+
>> OpenBSD/i386 BOOT 3.01
boot> bsd.oldIf you notice any errors, please let me know.
Other OpenBSD Tutorials
- Installation - demonstration of a FTP installation
- Patching - patching and kernel building
- Security - security suggestions
- Tips & Tricks - suggestions and configurations