If you want future FreeBSD update and upgrade routines to be simpler: please support the PkgBase initiative. See, for example, https://alpha.pkgbase.live/.
Guidance below is for 12.⋯
systems that:
- fall below
12.2-RELEASE-p4
(12.2
patch level4
) - boot from ZFS (not UFS).
All commands are to be run as root. Beyond step 7 below, aim to run each command in terminal that is away from (or without starting) the desktop environment. Hint:
- Control-Alt-F2 switches to terminal
ttyv1
- from there, Alt-F9 returns to the desktop environment.
If you never previously followed a freebsd-update(8) routine, please be prepared:
- to respond appropriately when presented with a colon
:
or(END)
at the command line – with q as the laziest effective response - for a possible requirement to use vi(1) for command line edition of some files.
For EFI system partition (ESP) boot loader guidance please see, for example:
- https://old.reddit.com/r/freebsd/comments/mq8wnq/freebsdannounce_freebsd_130release_now_available/guky1nd/
- Upgrade FreeBSD with ZFS Boot Environments | 𝚟𝚎𝚛𝚖𝚊𝚍𝚎𝚗 – there's also a more streamlined system upgrade routine, which requires fewer restarts through use of chroot(8) (but does not cover the current peculiarities of helloSystem).
pkg -v
- if the package management tool is not yet installed, allow it
pkg query '%R %o %v' | grep -v -e FreeBSD -e ports-mgmt\/pkg | sort > /var/log/exceptionalpackages.txt && cat /var/log/exceptionalpackages.txt
- if the query reveals anything (any package that was not installed from a
FreeBSD
package repository), be aware that thepkg upgrade
lines below might not cover what's required for an entirely successful upgrade – be prepared to act upon an on-screen hint to rebuild all installed 3rd party software (e.g., programs installed from the ports tree) du -h /var/cache/pkg && pkg clean -qy && pkg autoremove -qy && du -h /var/cache/pkg
bectl create 12.2-RELEASE-p6 && bectl activate 12.2-RELEASE-p6
- restart the computer
/usr/sbin/freebsd-update fetch install
freebsd-version -kru
- observe the mismatch
- restart the computer
/usr/sbin/freebsd-update install
- – there might be nothing applicable
pkg upgrade
/usr/sbin/freebsd-update install
- – there might be nothing applicable
- restart the computer
freebsd-version -kru
du -h /var/cache/pkg && pkg clean -qy && pkg autoremove -qy && du -h /var/cache/pkg
bectl create 13.0-RELEASE && bectl activate 13.0-RELEASE
- restart the computer
/usr/sbin/freebsd-update upgrade -r 13.0-RELEASE
/usr/sbin/freebsd-update install
freebsd-version -kru
- restart the computer
freebsd-version -kru
/usr/sbin/freebsd-update install
freebsd-version -kru
pkg upgrade
/usr/sbin/freebsd-update install
sed -i '' '/opensolaris/d' /boot/loader.conf && cat /boot/loader.conf
- restart the computer.
Some of the logic above is drawn from cutting edge Chapter 24 of the FreeBSD Handbook.
freebsd-version(1) lines are optional:
- for a person who has never previously used
freebsd-update
, observing the output fromfreebsd-version
might help to understand the state of things at various stages within routines such as this.
Package cleaning and autoremoval lines are optional:
- intended to help minimise the sizes of past boot environments that might be rarely or never required.
ttyv1
is recommended because (amongst other things) pkg upgrade
whilst signed in to a packaged desktop environment might adversely affect the running environment. If you prefer to run the commands in a terminal in a desktop environment, proceed with caution – beware of any running program prematurely loading an upgraded component; refrain from running any additional program; and so on.
The interim boot environment with 12.2-RELEASE-p6
(or greater) is:
- primarily for a fix to
freebsd-update
– if you skip the relevant steps, and if you subsequently find a problem with scripted or manual use of passwd(1) with 12.2-RELEASE-p3
(or less), you may:
- apply the two-line workaround in section IV of [FreeBSD-Announce] FreeBSD Errata Notice FreeBSD-EN-21:08.freebsd-update.
Hint: possible symptoms of a passwd
-related problem include pkg install falkon
failing at or around the mysql57-server
stage.
Use of vi
is avoidable:
- permanently set
EDITOR
andVISUAL
variables to/usr/local/bin/nano
– I have a GitHub gist for this, but it's not public.
You must:
pkg lock hello
If not already locked, this is to safeguard essential helloSystem files that are associated with the non-ported hello package, which has a nonconformist origin and a name that conflicts with a previously packaged port (misc/hello, unrelated to helloSystem).
Without the lock, pkg upgrade
will replace helloSystem's ambiguous hello < 2.10_1
with properly-defined misc/hello 2.10_1
. Replacement is proper – given the version numbers – however the consequences are unwanted. Related:
- https://github.com/helloSystem/ISO/commits/e5324c0e3fe430407fbe94083f4915f0a778c9fa/overlays/uzip/hello/manifest (origins of the problem)
- helloSystem/hello#67 (comment) ▶ https://lists.freebsd.org/pipermail/freebsd-ports/2021-March/120439.html sought advice from the freebsd-ports list.
In addition, if you find helloSystem preventing normal use of pkg(8), you should:
mv /usr/sbin/pkg.real /usr/sbin/pkg
– for the non-standard pkg
to be replaced by the real (FreeBSD-provided) package management tool.
On Reddit
https://old.reddit.com/r/freebsd/comments/lzrind/upgrade_freebsd_12_to_freebsd_13/