A major upgrade example: 14.4-RELEASE to 15.1-RELEASE
All commands should be run as root.
pkg updatepkg upgrade -Uy -r FreeBSD pkgfreebsd-update fetchfreebsd-update installfreebsd-update upgrade -r 15.1-RELEASEfreebsd-version -kru ; uname -mvKUfreebsd-update install- do not reboot the operating system – ignore the on-screen advice from freebsd-update
freebsd-version -kru ; uname -KU/bin/shexport abi=FreeBSD:15:$(uname -p)export osversion=1501000pkg-static -o ABI=$abi -o OSVERSION=$osversion -o IGNORE_OSVERSION=yes updatepkg-static -o ABI=$abi -o OSVERSION=$osversion -o IGNORE_OSVERSION=yes upgrade -Fqy- ignore all on-screen recommendations to force a bootstrap of pkg
pkg-static -o ABI=$abi -o OSVERSION=$osversion -o IGNORE_OSVERSION=yes upgrade -Fqypkg-static -o ABI=$abi -o OSVERSION=$osversion -o IGNORE_OSVERSION=yes upgrade -U -r FreeBSD-kmodspkg-static -o ABI=$abi -o OSVERSION=$osversion -o IGNORE_OSVERSION=yes upgrade -U -g 'virtualbox-ose-additions*'exit- upgrade the boot loader
- disable loading of kernel modules for NVIDIA GPUs – you can use sysrc(8)
shutdown -r +10min "restarting with the upgraded kernel and boot loader"- after this restart, if software such as Discover invites you to upgrade software, ignore the invitation
freebsd-version -krufreebsd-update install- be patient
freebsd-version -kru- if
/usr/local/etc/pkg/repos/FreeBSD.confincludes FreeBSD and FreeBSD-kmods, change the names to FreeBSD-ports and FreeBSD-ports-kmods pkg bootstrap -fypkg upgrade -fFqy -r FreeBSD-ports -r FreeBSD-ports-kmodspkg upgrade -fFqy -r FreeBSD-ports -r FreeBSD-ports-kmodspkg upgrade -fU -r FreeBSD-ports -r FreeBSD-ports-kmods- if reinstalling all third-party software is not possible, install misc/compat14x
- if the previous run of
freebsd-update installasked you to rerun the command, do so shutdown -r +10min "restarting with the upgraded userland"
14 Comments
grahamperrin@billboard.bsd.cafe · 3 pts · 66d
@kpax thanks.
Most readers will, understandably, think of thirty-three steps as ridiculous – partly because it felt good, historically, to portray FreeBSD upgrades as requiring no more than a handful of steps.
The "works for me" mindset, cutting corners without realising it, is true for some people, not for others. Some people:
– and so on.
Oversimplification of upgrade routines is popular, but not good practice.
Blog posts that regurgitate official documentation are good for bloggers who want clicks, but it's a problem when the basis for those posts is wrong.
Credit to Michael Larabel (Phoronix) for special attention to the essence of the third release candidate:
> Critical bug fixes to the x86 boot loader / kernel handoff which can cause the boot to hang; this seems to happen most often but not exclusively when Intel microcode updates are being loaded.
grahamperrin@billboard.bsd.cafe · 2 pts · 57d
I added another step (currently 33) for misc/compat14x.
kpax@billboard.bsd.cafe · 2 pts · 66d
Thank you for the ace instructions. I'm glad I waited to upgrade, as I didn't trust myself to be able to work out the kmod hiccup, but these were perfect. Just finished upgrading 15.0R-p10 to 15.1R and everything just works. Boot up is perceptibly faster, which is a nice cherry on top of the smooth upgrade. Edit: Now that the upgrade is complete, I'm going to bectl my way to trying a pkgbasify conversion. I was going to wait until 16.0R, but have half a mind of pulling the trigger early seeing as how these problems seemed non-existent on pkgbase and it's in our future anyway.
grahamperrin@billboard.bsd.cafe · 2 pts · 64d
Oracle VirtualBox
The FreeBSD-ports-kmods repo includes kernel modules for FreeBSD as a host but not as a guest:
Guest Additions
The FreeBSD-ports repo currently includes modules for 15.0 that do load with 15.1-RELEASE.
An example with latest:
grahamperrin@billboard.bsd.cafe · 2 pts · 67d
The guide above should help to avoid kernel panics and other issues with kernel modules.
Relevant documentation includes:
TomAoki notes the importance of upgrading the boot loader before – not after – the first boot of 15.1-RELEASE.
Thanks to Emrion in The FreeBSD Forums for inspiring the sh(1)-specific
exportlines.Cross-post: Modernised use of freebsd-update … : r/freebsd
grahamperrin@billboard.bsd.cafe · 1 pts · 57d
Users of freebsd-update(8) with 14.4-RELEASE, please note:
Noted:
> freebsd-update(8) may prompt to rebuild or reinstall all third-party software due to changes in system libraries. Follow those instructions as needed.
If I recall correctly, the instructions do not demonstrate use of
--force.Steps 28-35 above do include pkg commands that will ultimately force a combined upgrade from two repositories, excluding FreeBSD-base:
– there should be comparable advice in official documentation.
grahamperrin@billboard.bsd.cafe · 1 pts · 54d
> Upgrading with Distribution Sets …
Also, there's nothing about FreeBSD-ports-kmods.
grahamperrin@billboard.bsd.cafe · 1 pts · 67d
> upgrade the boot loader
sysutils/loaders-update
> Update bootcodes and loaders > > This utility is a tool designed to keep the FreeBSD bootcodes and loaders up-to-date. It's useful because the FreeBSD upgrade process doesn't update them. It verifies if they are up to date and updates them if desired.
grahamperrin@billboard.bsd.cafe · 1 pts · 64d
FreeBSD-ports-kmods and NVIDIA
Noted in Reddit:
> … kmods are built on freebsd 15 until its end of life, and then they are built on freebsd 15.1. > > which is why you get the problem when you upgrade to 15.1 of them not working and the kdl error, so you either need to build them from ports or use poudrire …
Essentially: users of NVIDIA GPUs should be prepared to build their own packages, for the non-base kernel modules, at times of minor and major OS upgrades.
ciotbsd@billboard.bsd.cafe · 1 pts · 64d
@grahamperrin
Brief digression: >Hum, I love Nvidia… hum, That's why I prefer to use an AMD GPU! Hummm, nvidia: NO; it's NO way! That said, I prefer to use an AMD GPU!
:p ;) :D
grahamperrin@billboard.bsd.cafe · 1 pts · 64d
grahamperrin@billboard.bsd.cafe · 1 pts · 64d
FreeBSD-ports-kmods and NVIDIA: additional information
grahamperrin said:
> … users of NVIDIA GPUs …
From https://mastodon.bsd.cafe/[@TomAoki](https://billboard.bsd.cafe/user/tomaoki)/116794082837691141 @TomAoki@bsd.cafe:
> … Nothing other than x11/nvidia-kmod are built currently. …
So, for example:
Relevant lines from the pkg-list in FreshPorts:
tychotithonus@infosec.exchange · 2 pts · 58d
@grahamperrin It is unfortunate (for the general user population) that the transition from
freebsd-updatetopkgdidn't turn this complexity into a wrapper before the transition, so they could ship simultaneously.grahamperrin@billboard.bsd.cafe · 1 pts · 67d
14.4-RELEASE to 15.0-RELEASE
Tested successfully with:
1500500as the osversionI hope that
1500500is appropriate. I took it from the FreeBSD 15 Versions section of Chapter 8 of the FreeBSD Porter's Handbook.grahamperrin@billboard.bsd.cafe · 1 pts · 57d
The RELEASE announcement at refers to a page that was originally a necessary duplicate of the upgrade instructions: . The
installationpage no longer exists:In the Wayback Machine: Upgrading with Base System Packages
> … Systems running 14.4-RELEASE or 15.0-RELEASE can be upgraded as follows: …
Now in the introduction:
> … 14.4-RELEASE or 15.0-RELEASE installations to 15.1-RELEASE. …
– and 14.4 is not mentioned for pkgbase:
> … 15.0-RELEASE can be upgraded …