How To Upgrade FreeBSD To New Release

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:
Change to (you can find cvsup mirror list here) :
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 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 '

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 4 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
4 comments… add one
  • Roland Jan 16, 2009 @ 22:32

    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 !

  • 🐧 nixCraft Jan 16, 2009 @ 23:21

    Thanks for the heads up. The FAQ has been updated.

  • Johan Kuuse Apr 13, 2009 @ 15:48

    A note on cvsup and csup:
    As indicated at

    csup is now the default command for updating source trees on FreeBSD.
    So to grab the update, change
    cvsup /root/supfile
    csup /root/supfile
    (or install /usr/ports/net/cvsup)


  • mahmud Mar 10, 2011 @ 14:04

    thanks very much, good tutor
    it’s very very help me

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum