Blue Flower

Updated 2/10/13: Updated for FreeBSD 10 and update to pkg system.

This updating to -STABLE guide will be a new rewrite with a few modifications. The CVSup method of retrieving and synchronizing the Ports Collection is being deprecated as part of a migration to Subversion. While it remains supported, the service will be discontinued as of February 28, 2013.

How to update from -RELEASE to -STABLE

Copied with permission by the author

Updating to -STABLE

Original page by Jochem Kossen

Abstract: After a FreeBSD -RELEASE has been released, development continues to the next version. Development is done in a number of branches, like -STABLE and -CURRENT. In this article I'll explain how to track the -STABLE branch.-STABLE is the branch which will bring the next stable release. -CURRENT is the unstable development branch. -CURRENT is only meant for developers!

Note: -STABLE is a BRANCH. That means it is being developed constantly. This also means -STABLE could be broken at any moment. Do not worry though, I've never noticed any problem with it.

Installing subversion is no longer necessary. 10.3 base now includes svnlite. This has been updated below.

Deleting the current sources

First lets get rid of the current /usr/src:


# rm -dfr /usr/src
# mkdir /usr/src

A list of the current subversion sites are below.

https://www.freebsd.org/doc/handbook/svn.html#svn-mirrors

Now we need to checkout both ports and sources using the following commands. Replace HOST with the closest mirror to you (See link above). Also on the 2nd line if you are using FreeBSD 9 then the command shown will work fine.


# cd /usr/src
# svnlite checkout https://svn.FreeBSD.org/base/stable/10 /usr/src

Please DO NOT continue until at least the sources are updated via svn

Building the base system and kernel

Read /usr/src/UPDATING

UPDATING contains important information and clues needed for upgrading FreeBSD. It could be you need to add a user first, or enable a device in your kernel, or whatever. Things like this are in UPDATING, so read it:


# less /usr/src/UPDATING

Remove old obj files. The very first time you run the second or third command, don't be surprised if you see "no match"


# cd /usr/obj
# chflags -R noschg *
# rm -fr *

Update files essential for buildworld


# mergemaster -p

You will get prompted Do you wish to delete what is left of /var/tmp/temproot? [no]. Hit Enter for No. It will spit out an output. Continue on.

Build the world (This can take a REALLY long time. On a 500Mhz PC It can take over an hour-and-a-half.)

If you have a multi-core processor, or multi-processor system, you can do:

# make -jX buildworld

Replace X with the number of total processor cores your system has plus 1. So, on a single CPU dual-core processor, you'd use -j3.


# cd /usr/src
# make buildworld

Build the kernel
(change MYKERNEL to the name of your custom kernel configuration file or GENERIC if you don't use a custom configured kernel)


# cd /usr/src
# make buildkernel KERNCONF=MYKERNEL

Installing the base system and kernel

Install your new kernel:

(change MYKERNEL to the name of your custom kernel configuration file or GENERIC if you don't use a custom configured kernel)


# cd /usr/src
# make installkernel KERNCONF=MYKERNEL

We will get more into customizing your kernel later.

Booting into single-user mode

Reboot with your new kernel into single-user mode


# reboot

When your computer reboots, It will bring you to a menu of options. Choose Single-User mode and hit Enter.
Hit [Enter] to boot immediately, or any other key for command prompt.

Booting [kernel] in 9 seconds...

Hit any other key other than [ENTER] to enter single-user mode.

It asks for the location of the shell to be used

choose /bin/sh (just press Enter or Return as this is the default)

Now we need to mount the filesystems


# mount -a -t ufs

Now to Install world


# cd /usr/src
# mergemaster -p

You will get prompted Do you wish to delete what is left of /var/tmp/temproot? [no]. Hit Enter for No. It will spit out an output. Continue on.


# make installworld

Update /etc


# rm -fr /etc.old

(The very first time you run this command, don't be surprised if you see "no match" )


# cp -Rp /etc /etc.old
# /usr/sbin/mergemaster

Reboot and enjoy your new -STABLE system


# fastboot