FreeBSD 12 released: Here is how to upgrade FreeBSD 11 to 12

last updated in Categories Howto, Open Source

The FreeBSD project announces the availability of FreeBSD 12.0-RELEASE. It is the first release of the stable/12 branch. The new version comes with updated software and features for a wild variety of architectures. The latest release provides performance improvements and better support for FreeBSD jails and more. One can benefit greatly using an upgraded version of FreeBSD.

FreeBSD 12.0 supports amd64, i386, powerpc, powerpc64, powerpcspe, sparc64, armv6, armv7, and aarch64 architectures. One can run it on a standalone server or desktop system. Another option is to run it on Raspberry PI computer. FreeBSD 12 also runs on popular cloud service providers such as AWS EC2/Lightsail or Google compute VM.

FreeBSD 12 released – What’s new?

New features and highlights:

  1. OpenSSL version 1.1.1a (LTS)
  2. OpenSSH server 7.8p1
  3. Unbound server 1.8.1
  4. Clang and co 6.0.1
  5. The FreeBSD installer supports EFI+GELI as an installation option
  6. VIMAGE FreeBSD kernel configuration option has been enabled by default. VIMAGE was the main reason I custom compiled FreeBSD for the last few years. No more custom compile for me.
  7. Graphics drivers for modern ATI/AMD and Intel graphics cards are now available in the FreeBSD ports collection
  8. ZFS has been updated to include new sysctl(s), vfs.zfs.arc_min_prefetch_ms and vfs.zfs.arc_min_prescient_prefetch_ms, which improve performance of the zpool scrub subcommand
  9. The pf packet filter is now usable within a jail using vnet
  10. KDE updated to version 5.12.5
  11. The NFS version 4.1 includes pNFS server support
  12. Perl 5.26.2
  13. The default PAGER now defaults to less for most commands
  14. The dd utility has been updated to add the status=progress option to match GNU/Linux dd command to show progress bar while running dd
  15. FreeBSD now supports ext4 for read/write operation
  16. Python 2.7 and more

How to upgrade FreeBSD 11 to 12

First note down the FreeBSD version by running the following commands:
freebsd-version
uname -mrs

Sample outputs:

11.3-RELEASE-p3

Make sure both FreeBSD base OS:
freebsd-update fetch install
Sample outputs:

11.3-RELEASE-p3:
/boot/kernel/kernel
/boot/kernel/mqueuefs.ko
/boot/kernel/sound.ko
/boot/kernel/vmm.ko
/usr/lib/debug/boot/kernel/kernel.debug
/usr/lib/debug/boot/kernel/mqueuefs.ko.debug
/usr/lib/debug/boot/kernel/sound.ko.debug
/usr/lib/debug/boot/kernel/vmm.ko.debug
Installing updates...  done.

Next update packages too, run the pkg command
pkg update && pkg upgrade
See FreeBSD Applying Security Updates Using pkg/freebsd-update for more info.

WARNING: Make sure you backup all important data, config files, and database tables/DBS. The author is not responsible for any data loss and upgrading FreeBSD should only be attempted after backing up all data.

Upgrading from previous releases of FreeBSD 11.3 to 12.0 using binary method

Type the following freebsd-update command:
freebsd-update -r 12.0-RELEASE upgrade

How to upgrade FreeBSD 11 to 12
Binary upgrades between RELEASE versions are supported using the freebsd-update utility

The freebsd-update will evaluate the configuration file and might prompt you as follows for config file merging and other options:

Does this look reasonable (y/n) y
....
...
/bin/rmail
/bin/rmdir
/bin/setfacl
/bin/sh
/bin/sleep
/bin/stty
/bin/sync
/bin/tcsh
/bin/test
/bin/unlink
/bin/uuidgen
/boot
To install the downloaded upgrades, run "/usr/sbin/freebsd-update install".

Once everything downloaded, merged in a directory, it is time to commit changes to the disk, run:
freebsd-update install
Sample outputs:

Installing updates...
Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.

Therefore, reboot the FreeBSD box:
reboot
Once the system has come back online, restart freebsd-update using the following command to remove all old shared libraries and object files:
freebsd-update install
Sample outputs:

Installing updates...
Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/usr/sbin/freebsd-update install"
again to finish installing updates.

Now base system has been updated. It is time to update all binary packages too. Simply run the following pkg command:
pkg-static install -f pkg
pkg update
pkg upgrade

Sample outputs:

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (39 candidates): 100%
Processing candidates (39 candidates): 100%
The following 42 package(s) will be affected (of 0 checked):
 
New packages to be INSTALLED:
	gdb: 8.2
	expat: 2.2.6_1
	libiconv: 1.14_11
 
Installed packages to be UPGRADED:
	ca_root_nss: 3.40.1 -> 3.41
 
Installed packages to be REINSTALLED:
	sudo-1.8.25p1 (ABI changed: 'freebsd:11:x86:64' -> 'freebsd:12:x86:64')
	sqlite3-3.25.1 (ABI changed: 'freebsd:11:x86:64' -> 'freebsd:12:x86:64')
	readline-7.0.3_1 (ABI changed: 'freebsd:11:x86:64' -> 'freebsd:12:x86:64')
.....
...
....
	binutils-2.30_5,1 (ABI changed: 'freebsd:11:x86:64' -> 'freebsd:12:x86:64')
 
Number of packages to be installed: 3
Number of packages to be upgraded: 1
Number of packages to be reinstalled: 38
 
The process will require 53 MiB more space.
145 MiB to be downloaded.
 
Proceed with this action? [y/N]: y
[1/42] Fetching sudo-1.8.25p1.txz: 100%  682 KiB 698.3kB/s    00:01    
[2/42] Fetching sqlite3-3.25.1.txz: 100%    1 MiB 266.6kB/s    00:05    
....
..
...
[42/42] Fetching libiconv-1.14_11.txz: 100%  601 KiB 615.9kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/42] Reinstalling indexinfo-0.3.1...
[1/42] Extracting indexinfo-0.3.1: 100%
[2/42] Reinstalling readline-7.0.3_1...
[2/42] Extracting readline-7.0.3_1: 100%
[3/42] Reinstalling libffi-3.2.1_2...
....
..
...
By default panic reports will be sent to root with instructions to forward
them if they do not contain any sensitive information.  To automatically
submit panic reports directly, add
	panicmail_autosubmit="YES"
to your /etc/rc.conf in addition.
Message from gcc6-6.4.0_8:
 
To ensure binaries built with this toolchain find appropriate versions
of the necessary run-time libraries, you may want to link using
 
  -Wl,-rpath=/usr/local/lib/gcc6
 
For ports leveraging USE_GCC, USES=compiler, or USES=fortran this happens
transparently.

One more last time and you are done:
/usr/sbin/freebsd-update install
Please note that it is also possible to upgrade the system using source based method. You need to read the information provided in /usr/src/UPDATING file.

How to verify FreeBSD 11 to 12 upgrade

Make sure all services are running:
ps aux
sockstat -l
sockstat -4
sockstat -6
netstat -a -n | grep LISTEN
top

Related : FreeBSD Unix Find Out Which Programs Are Listening On a Given Port Number

Check out for errors in log file using the cat command/grep command/egrep command and other tools:
tail -f /var/log/messages
grep error /path/to/app
egrep -i 'err|warn|cri' /var/log/messages

See version:
uname -mrs
freebsd-version

How to upgrade FreeBSD 11 to 12 and verification commands
FreeBSD 11 upgraded to 12 running on my Google cloud VM

Do I need to upgrade FreeBSD to 12 ASAP?

Not really. FreeBSD 11.2 continues to support. There is no need to rush. You can wait for some time and apply updates when you are free.
Supported FreeBSD releases

Conclusion

Overall FreeBSD 12 lead an even more robust BSD family of the operating system for end users, and it would benefit significantly for FreeBSD based open source projects such as FreeNAS, pfSense and others. For more information see FreeBSD download page here and release note here.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at www.nixcraft.com

Historical Comment Archive

1 comment

    Still, have a question? Get help on our forum!