General Information
This guide will walk a user through updating his source to follow FreeBSD’s stable branch. Please make a full backup of the current system before following this guide.
Requirements
- A working install of FreeBSD 5.x (steps may work in other versions)
- Root access
- Internet access
Installation
Login as root (or login as a user and su to root). Install cvsup and fastest_cvsup with either of the following methods.
# cd /usr/ports/net/cvsup_without_gui # make install distclean # cd /usr/ports/sysutils/fastest_cvsup # make install distclean
or
# pkg_add -r cvsup-without-gui # pkg_add -r fastest_cvsup
Copy the sample supfile for Stable to the root directory
# cp /usr/share/examples/cvsup/stable-supfile /root
Run cvsup to download the latest stable source using the fastest cvsup server near you.
# cvsup -L 2 -h `(fastest_cvsup -q -c us )` /root/stable-supfile
When the cvsup has completed, change to the /usr/src directory
# cd /usr/src
Now take the time to read /usr/src/UPDATING. This file will contain information that may be needed to properly update the FreeBSD source.
Now it is time to compile this source. This is called building world.
# make -j4 buildworld
Now build a new kernel. To rebuild the GENERIC kernel, simply run the following command:[/code]
# make buildkernel
To build a new kernel using a custom kernel configuration file, run the command as follows:
# make buildkernel KERNCONF=MYKERNEL
Now boot to single-user mode. This is important because replacing system files while in use in a running system is not a good idea.
# shutdown now
Once in single-user mode, run the following commands to get access to the file system and the swap.
# fsck -p # mount -u / # mount -a -t ufs # swapon -a
Change to the /usr/src directory.
# cd /usr/src
Now install the new kernel. To install the rebuilt GENERIC kernel, simply run the following command:
# make installkernel
To install a newly built custom kernel, run the command as follows:
# make installkernel KERNCONF=MYKERNEL
Reboot
# reboot
On boot up, select option 4 to boot to single-user mode. Once in single-user mode, run the following commands to get access to the file system and the swap.
# fsck -p # mount -u / # mount -a -t ufs # swapon -a
Change to the [code]/usr/src directory.
# cd /usr/src
Run mergemaster -p to compare only those files that are essential for the success of buildworld or installworld.
# mergemaster -p
Select No to when prompted to remove /var/tmp/temproot. Now install the new world.
# make installworld
Now run mergemaster to compare all the configuration files.
# mergemaster
Reboot the system.
# reboot
Once the reboot has completed, the system should boot the stable release. Login and verify that everything is working correctly.
http://www.bsdguides.org/guides/freebsd/misc/update_ports_tree.php