Upgrading from FreeBSD 10.3 to 11.0 (major upgrade)

Performing a major upgrade isn’t much different from doing a minor upgrade as far as ease goes. However more can go wrong. Here we’ll discuss the basic commands to get through it.

First we want to get to the latest and greatest minor version patch level of FreeBSD.

$ sudo freebsd-update fetch
Looking up update.FreeBSD.org mirrors... 4 mirrors found.
Fetching metadata signature for 10.3-RELEASE from update6.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata patches.. done.
Applying metadata patches... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 324 patches.....10....20....30. done.
Applying patches... done.
Fetching 40 files... done.

The following files are affected by updates, but no changes have
been downloaded because the files have been modified locally:
/etc/mail/freebsd.cf
/etc/mail/freebsd.submit.cf
/etc/mail/sendmail.cf
...

The following files will be removed as part of updating to 10.3-RELEASE-p15:
/usr/share/zoneinfo/America/Santa_Isabel
/usr/share/zoneinfo/Asia/Rangoon

The following files will be added as part of updating to 10.3-RELEASE-p15:
/usr/share/zoneinfo/Asia/Barnaul
/usr/share/zoneinfo/Asia/Famagusta
/usr/share/zoneinfo/Asia/Tomsk
/usr/share/zoneinfo/Asia/Yangon
...

The following files will be updated as part of updating to 10.3-RELEASE-p15:
/bin/freebsd-version
/lib/libc.so.7
/rescue/[
/rescue/atmconfig
/rescue/badsect
...

$ sudo freebsd-update install
Installing updates... done.

Now let’s do the major upgrade:

$ sudo freebsd-update upgrade -r 11.0-RELEASE
Looking up update.FreeBSD.org mirrors... 4 mirrors found.
Fetching metadata signature for 10.3-RELEASE from update3.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic src/src world/base world/games world/lib32

The following components of FreeBSD do not seem to be installed:
world/doc

Does this look reasonable (y/n)? y

Fetching metadata signature for 11.0-RELEASE from update3.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 10.3-RELEASE for merging... done.
Preparing to download files... done.
Fetching 45032 patches.....10....20....30....40....50. done.
Applying patches... done.
Fetching 12099 files... done.
Attempting to automatically merge changes in files... done.

The following file could not be merged automatically: /etc/defaults/rc.conf
Press Enter to edit this file in /usr/bin/vi and resolve the conflicts
manually...

At this point you’ll be placed into various files that have merge conflicts. They will need to be resolved. In each file you will see the markers that designate the old files content vs the new files content such as:

<<<<<<< current version
# $FreeBSD: release/10.3.0/etc/syslog.conf 194005 2014-06-11 15:07:02Z avg $
=======
# $FreeBSD: release/11.0.0/etc/syslog.conf 238473 2016-07-15 10:55:43Z brueffer $
>>>>>>> 11.0-RELEASE

Basically you will choose which content wins (typically the new content) by removing the markers and the old content. So in this example you would end up with:

# $FreeBSD: release/11.0.0/etc/syslog.conf 238473 2016-07-15 10:55:43Z brueffer $

Now we will continue on. Next you will be asked if various merges that did not have conflicts look reasonable.

The following changes, which occurred between FreeBSD 10.3-RELEASE and
FreeBSD 11.0-RELEASE have been merged into /etc/defaults/periodic.conf:
Does this look reasonable (y/n)?

The following files are affected by updates, but no changes have
been downloaded because the files have been modified locally:
/.cshrc
/.profile
/root/.cshrc
/root/.k5login
/root/.login
/root/.profile
...
To install the downloaded upgrades, run "/usr/sbin/freebsd-update install".

$ sudo freebsd-update install
$ sudo shutdown -r now

$ hostver
FreeBSD 10.3 RELEASE-p15

$ sudo freebsd-update install
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.

$ hostver
FreeBSD 11.0 RELEASE-p6

$ uname -r
11.0-RELEASE-p2

$ sudo shutdown -r now

Now lets upgrade the packages on the system.

$ sudo pkg upgrade
pkg: Warning: Major OS version upgrade detected.  Running "pkg-static install -f pkg" recommended
Updating FreeBSD repository catalogue...
Repository FreeBSD has a wrong packagesite, need to re-create database
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01
Fetching packagesite.txz: 100%    6 MiB   5.9MB/s    00:01
Processing entries: 100%
FreeBSD repository update completed. 25901 packages processed.
New version of pkg detected; it needs to be installed first.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        pkg: 1.9.3 -> 1.9.4_1

Number of packages to be upgraded: 1

3 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching pkg-1.9.4_1.txz: 100%    3 MiB   2.9MB/s    00:01
Checking integrity... done (0 conflicting)
[1/1] Upgrading pkg from 1.9.3 to 1.9.4_1...
[1/1] Extracting pkg-1.9.4_1: 100%
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking for upgrades (102 candidates): 100%
Processing candidates (102 candidates): 100%
The following 104 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        readline: 6.3.8
        libnghttp2: 1.18.1

Installed packages to be UPGRADED:
        zsh: 5.2_4 -> 5.3.1
        vim-lite: 8.0.0063 -> 8.0.0134_1
        trousers: 0.3.13_1 -> 0.3.14_1
        sudo: 1.8.18p1 -> 1.8.19p1
        subversion: 1.9.4 -> 1.9.5
        sqlite3: 3.14.1_1 -> 3.15.1_1
        ruby: 2.2.5_1,1 -> 2.2.6_1,1
        rsync: 3.1.2_5 -> 3.1.2_6
        python27: 2.7.12 -> 2.7.13_1
        ...

Installed packages to be REINSTALLED:
        zfs-stats-1.2.2_1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        urlview-0.9.20131021_1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        unzip-6.0_7 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        ttcp-1.12_1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        ...

Number of packages to be installed: 2
Number of packages to be upgraded: 38
Number of packages to be reinstalled: 64

The process will require 5 MiB more space.
110 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching zsh-5.3.1.txz: 100%    4 MiB   4.1MB/s    00:01
Fetching zfs-stats-1.2.2_1.txz: 100%    9 KiB   9.5kB/s    00:01
Fetching vim-lite-8.0.0134_1.txz: 100%    5 MiB   5.5MB/s    00:01
...
Checking integrity... done (0 conflicting)
[1/104] Reinstalling indexinfo-0.2.6...
[1/104] Extracting indexinfo-0.2.6: 100%
[2/104] Reinstalling libffi-3.2.1...
[2/104] Extracting libffi-3.2.1: 100%
[3/104] Upgrading gettext-runtime from 0.19.8.1 to 0.19.8.1_1...
[3/104] Extracting gettext-runtime-0.19.8.1_1: 100%
...

Finally we’ll upgrade any perl modules on the system from cpan.

$ sudo cpan-outdated | sudo cpanm

So, to recap the commands are as follows and in this order:

$ sudo freebsd-update fetch
$ sudo freebsd-update install
$ sudo freebsd-update upgrade -r 11.0-RELEASE
$ sudo freebsd-update install
$ sudo shutdown -r now
$ sudo freebsd-update install
$ sudo pkg upgrade
$ sudo cpan-outdated | sudo cpanm

Leave a comment