FreeBSD cvsup: Update The FreeBSD From Previous Releases Using Source Code
Q. How do I update my system using cvsup mirror? How do I upgrade from previous releases using FreeBSD 6.x or 7.x? How do I upgrade everything including kernel, userland utilities, and installed applications?
A. FreeBSD can be upgrades from a local / remote cvsup mirror. csup is a software package for updating collections of files across a network. It is a general-purpose network file updating package. It is extremely fast, even for collections of files.
Upgrading FreeBSD
You need to upgrade FreeBSD using two steps as follows:
- First, upgrade the base system
- Update all installed application programs or ports.
Naturally, the base system must be upgraded before the applications.
WARNING! These examples only works with FreeBSD 6.2 or above version only. Make a backup of your system / data / config files before you use following commands. The system will be offline for about 10-30 minutes due to reboot and single user mode upgrade operations, so update system during off-peak hours.Step # 1: Upgrading the FreeBSD base system
First, copy csup configuration file to /etc or /root directory:
# cp /usr/share/examples/cvsup/standard-supfile /root/supfile
Open /root/supfile using vi text editor, enter:
# vi /root/supfile
You need to make one change. Find the line that read as follows:
host=CHANGE_THIS.FreeBSD.org
Change to:
host=cvsup4.us.FreeBSD.org
host directive specifies the server host which will supply the file updates. You must change it to one of the CVSup mirror sites listed in the FreeBSD Handbook. Another option is to override this setting on the command line with cvsup's "-h host" option. Save and close the file. Now update source tree, enter:
# cd /usr/src
# csup /root/supfile
Build the base system
Once you have synchronized your local source tree, you can then use the source tree to rebuild the base system. It is important that you always read /usr/src/UPDATING file to save time. This file carries important information regarding upgrade procedure including known issues, bugs and workaround.
# vi /usr/src/UPDATING
Type the following command to build base system:
# cd /usr/src
# make buildworld
This procedure going to take sometime as everything is going to compiled from scratch. Powerful system with tons of memory can build everything within 10-15 minutes time. Once done build the FreeBSD kernel:using following syntax:
# make buildkernel
# make installkernel
OR
# make kernel KERNCONF={NAME}
For example, build and install GENERIC kernel, enter:
# make kernel KERNCONF=GENERIC
# make installkernel KERNCONF=GENERIC
Again depending on the capabilities of your machine and kernel configuration, it will take anywhere from 5-30 minutes to build kernel. Finally, you need to reboot system and boot into a single user mode using boot -s from the loader prompt:
# reboot
Install the base system
Now you need to use the mergemaster bourne shell script, which is designed to aid you in updating the various configuration and other files associated with FreeBSD. It is HIGHLY recommended that you back up your /etc directory. To install some system configuration files that are required by the new base system, enter:
# cd /usr/src
# mergemaster -p
Accept the changes as promoted as per your configuration. Finally, install the base system:
# make installworld
Finally, merge your configuration files, enter:
# mergemaster -i
You are now done with first stage, just reboot the system:
# reboot
Step # 2: Update FreeBSD Applications
Now you are running new FreeBSD environment. All you have to do is upgrade installed applications using portsnap, enter:
# portsnap fetch extract
To upgrade all installed FreeBSD ports / apps, enter:
# portversion
# portupgrade -a
You are now done with upgrading system. Now you have up to date patched kernel, base system and applications.
Further readings:
- man pages - portversion, portupgrade, pkgdb, make, mergemaster,csup, make.conf
- FreeBSD handbookt rebuilding world
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- FreeBSD make: don't know how to make buildkernel. Stop Error and Solution
- How To Upgrade FreeBSD 6.3 to 7.0 Stable Release
- FreeBSD Install Applications
- Run ASP.Net on a Linux, Solaris UNIX, Mac OS X or FreeBSD
- FreeBSD Install Strace - A Process Tracer And Debugging Tool
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: /etc/make.conf, build freebsd kernel, csup command, freebsd build basesystem, freebsd buildworld, make command, mergemaster command, pkgdb command, portupgrade command, portversion command, software package




Recent Comments
Today ~ 3 Comments
Today ~ 5 Comments
Today ~ 1 Comment
Yesterday ~ 1 Comment
Yesterday ~ 2 Comments