Q. I've custom compile kernel and I'd like to upgrade my system to latest stable release. How do I upgrade FreeBSD to new release without using freebsd-update binary tool?
A. If you have custom kernel installed freebsd-update will not work. The procedure for doing a source code based update is described below.
Step # 1: Grab latest source code
You need to use csup, which is a software package for updating collections of files across a network. First, copy config a file to /root, type:
# cp /usr/share/examples/cvsup/standard-supfile /root/supfile
Open /root/supfile, type:
# vi /root/supfile
Find the line that read as follows:
host=CHANGE_THIS.FreeBSD.org
Change to (you can find cvsup mirror list here) :
host=cvsup4.us.FreeBSD.org
Make sure tag is set to tag=RELENG_7_1 (for latest FreeBSD 7.1 release)
*default release=cvs tag=RELENG_7_1
Here is my sample /root/supfile file:
*default host=cvsup4.us.FreeBSD.org *default base=/var/db *default prefix=/usr *default release=cvs tag=RELENG_7_1 *default delete use-rel-suffix *default compress
To grab update, enter:
# cvsup /root/supfile
Step #2: 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
Once you are aware of all issues, first build base system, enter:
# cd /usr/src
# make buildworld
Step #3: Build the FreeBSD kernel
Next, build and install the FreeBSD kernel using the following syntax:
# make buildkernel
# make installkernel
To build and install custom kernel named foo, enter:
# make buildkernel KERNCONF=foo
# make installkernel KERNCONF=foo
Finally, reboot the server, enter:
# reboot
Boot into a single user mode
You need to boot FreeBSD into a single user mode type boot -s at the loader prompt:
boot -s
Mount file system and run mergemaster, enter:
# mount -a -t ufs
# mergemaster -p
Accept the changes as promoted as per your configuration.
Step # 4: Install base system and libraries
Type the following command, enter:
# cd /usr/src
# make installworld
Finally, merge your configuration files, enter:
# mergemaster -i
You are now done with first stage, just reboot the system:
# reboot
Verify everything is working
See system log files and make sure everything is working properly, enter:
# uname -a
# tail -f /var/log/messages
# tail -f /path/to/other/log/files
# sockstat
Step # 5: Update FreeBSD Applications
Finally, update all installed applications such as Apache, postfix and others, enter:
# portsnap fetch update
To upgrade all installed FreeBSD ports / applications, enter:
# portversion -l '<'
# portupgrade -a
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 4 comments… read them below or add one }
You might wanna call that second #2 as it is supposed to: #3 and fix kernel:
Step #2: Build the FreeBSD kerenl
I noticed that when I added it to my kb, author is still mentioned tho ;)
Thanks, this helped me out bigtime !
Thanks for the heads up. The FAQ has been updated.
A note on cvsup and csup:
As indicated at
http://www.freebsd.org/doc/en/books/handbook/cvsup.html
csup is now the default command for updating source trees on FreeBSD.
So to grab the update, change
cvsup /root/supfile
to
csup /root/supfile
(or install /usr/ports/net/cvsup)
Regards,
Johan
thanks very much, good tutor
it’s very very help me