On a 14.2-STABLE host (commit 0ff2b4a85b66d5fb8cf526a47c6367671bc2bc42), I just created a 14.2-RELEASE jail. As per the usual workflow, I tried to freebsd-update it. However, that didn't go all that well. freebsd-update complained that it cannot upgrade from a version that is not a release. Steps: # fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.2-RELEASE/base.txz -o /usr/local/jails/media/14.2-RELEASE-base.txz # tar -xf /usr/local/jails/media/14.2-RELEASE-base.txz -C /usr/local/jails/templates/14.2-RELEASE --unlink # freebsd-update -b /usr/local/jails/templates/14.2-RELEASE/ fetch install src component not installed, skipped freebsd-update: Cannot upgrade from a version that is not a release (including alpha, beta and release candidates) using freebsd-update. Instead, FreeBSD can be directly upgraded by source or upgraded to a RELEASE/RELENG version prior to running freebsd-update. Currently running: 14.2-STABLE
thanks Joel. I'm not sure that freebsd-update is supported in this way. I'll let others chime in on that. > doas freebsd-update -r 14.2-RELEASE -b /tmp/stuff upgrade src component not installed, skipped freebsd-update: Cannot upgrade from a version that is not a release (including alpha, beta and release candidates) using freebsd-update. Instead, FreeBSD can be directly upgraded by source or upgraded to a RELEASE/RELENG version prior to running freebsd-update. Currently running: 15.0-CURRENT For your use case instead, use the jail-specific functionality built into fbsd-update: e.g. for a jail called stuff: # freebsd-update -r 14.2-RELEASE -j stuff upgrade - used a 14.1-RELEASE jail - from a 15.0-CURRENT host - to update to 14.2-RELEASE - and then again to patch to p0 # freebsd-update -r 14.2-RELEASE -j stuff upgrade # freebsd-update -r 14.2-RELEASE -j stuff install # freebsd-update -j stuff install # freebsd-update -j stuff fetch install ... No updates needed to update system to 14.2-RELEASE-p0. No updates are available to install. If the directory you want to upgrade is not an active jail, either jail it ;-) or run the upgrade within the jail dir as chroot.
I'm confused... I got this straight out of the handbook, section 17.5.1. Both my intention and the intention of the handbook seems to update the base before you actually create a jail. > Once the update is finished, the template is ready. Should this PR become a docs@ PR instead then?
I think we should allow freebsd-update to handle this case, but I'll wait for clarification from cperciva et al before looking into it.
`freebsd-update` assumes that the system it's updating matches the kernel it's running on. If that is not the case, you need to pass the correct version using the `--currently-running` option, as described in the documentation.
Thank you for your inputs, guys. Using --currently-running I got the expected behavior/output: # freebsd-update --currently-running 14.2-RELEASE -b /usr/local/jails/templates/14.2-RELEASE/ fetch install src component not installed, skipped Looking up update.FreeBSD.org mirrors... 3 mirrors found. Fetching public key from update1.freebsd.org... done. Fetching metadata signature for 14.2-RELEASE from update1.freebsd.org... done. Fetching metadata index... done. Fetching 1 metadata files... done. Inspecting system... done. Preparing to download files... done. No updates needed to update system to 14.2-RELEASE-p0. No updates are available to install. As per my understanding, this is therefore neither a bug nor a mistake in the handbook but rather just lack of understanding on my end. Therefore, I'm closing this PR. Thank you!
I'll add this to the handbook in the spot you mentioned.
Proposed an error for this case (-b without --currently-running/UNAME_r): https://reviews.freebsd.org/D48016
(In reply to Joel Bodenmann from comment #0) I think your problem is that freebsd-update by default takes the system to expect as installed from kernel via sysctls which is FreeBSD 14-stable. You have to either override that with arguments/environment variables or run it inside a jail with osversion and osreldate set to the jail userland version. Also as of today there is no FreeBSD 14.2 patch to update to (yet). If you upgrade a jail like that e.g. from 14.1 to 14.2 you have to modify the two version parameters afterward.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=097458ac665db732cc91a22279da4cc14f694da2 commit 097458ac665db732cc91a22279da4cc14f694da2 Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-12-10 13:47:34 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2026-02-11 15:44:45 +0000 freebsd-update: Error for -b basedir without UNAME_r set freebsd-update sets the currently running release from UNAME -r, which can be overridden via the --currently-running commandline option (or by setting UNAME_r in the environment). This may be invalid if -b is used to specify a basedir other than /, so error out if -b is specified without setting the currently running version. PR: 283229 Reviewed by: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48016 usr.sbin/freebsd-update/freebsd-update.sh | 4 ++++ 1 file changed, 4 insertions(+)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d37214da968b8f381e7b67f80607e0865d873f5e commit d37214da968b8f381e7b67f80607e0865d873f5e Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-12-10 13:47:34 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2026-02-27 19:59:04 +0000 freebsd-update: Error for -b basedir without UNAME_r set freebsd-update sets the currently running release from UNAME -r, which can be overridden via the --currently-running commandline option (or by setting UNAME_r in the environment). This may be invalid if -b is used to specify a basedir other than /, so error out if -b is specified without setting the currently running version. PR: 283229 Reviewed by: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48016 (cherry picked from commit 097458ac665db732cc91a22279da4cc14f694da2) usr.sbin/freebsd-update/freebsd-update.sh | 4 ++++ 1 file changed, 4 insertions(+)