Modernised use of freebsd-update for minor and major upgrades to FreeBSD
-
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
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 the previous run of
freebsd-update installasked you to rerun the command, do so shutdown -r +10min "restarting with the upgraded userland"
-
The guide above should help to avoid kernel panics and other issues with kernel modules.
Relevant documentation includes:
- freebsd-update(8)
- FreeBSD 15.1-RELEASE Upgrading Instructions | The FreeBSD Project (2026-06-15) – bugged.
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
-
G grahamperrin@mastodon.bsd.cafe shared this topic
D dkade@mastodon.bsd.cafe shared this topic
-
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
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 the previous run of
freebsd-update installasked you to rerun the command, do so shutdown -r +10min "restarting with the upgraded userland"
upgrade the boot loader
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.
-
14.4-RELEASE to 15.0-RELEASE
Tested successfully with:
1500500as the osversion- latest for FreeBSD and FreeBSD-kmods.
I hope that
1500500is appropriate. I took it from the FreeBSD 15 Versions section of Chapter 8 of the FreeBSD Porter's Handbook.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login