How to upgrade FreeBSD 11 to 12

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

Make sure both FreeBSD base and packages are updates:
freebsd-update fetch install
pkg update && pkg upgrade

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.2 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
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.
How to upgrade FreeBSD 11 to 12

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.

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: