After upgrading a system to 12.2-RELEASE-p2, I was super confused, and not as innocuously, some automation and provisioning broke due to following:
# uname -r
# freebsd-update fetch
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 12.2-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.
No updates needed to update system to 12.2-RELEASE-p2.
Was this a slip on latest patch due to how quickly it had to be prepared? Or is uname -r an unreliable way to get the patch version on FreeBSD?
Yes, correct way is to use freebsd-version(1), check the man page for options.
https://www.freebsd.org/security/advisories/FreeBSD-SA-20:33.openssl.asc update openssl files, but not kernel.
uname show kernel version only, but not system version.
Thanks, I have read both freebsd-version(1) and uname(1).
Indeed that, and seeking not to special-case FreeBSD when dealing with multiple BSDs is where confusion comes from.
For comparison, uname(1) in other BSDs:
-r print the operating system release.
And from uname(1) in FreeBSD:
-r Write the current release level of the operating system to
That description would seem to imply that "12.2-RELEASE-p2" is the expected output on a fully upgraded system.
The replies to this bug report appear to indicate that that's not supposed to be the case, so could we patch uname(1) to reflect what uname -r actually means?
I lack the understanding as to what the slight difference is and what exactly uname -r means, so I don't feel confident proposing the documentation patch.
I have the same behaviour on three boxes as below. I have not updated more than this three computers.
The running kernel is reported as 12.2-RELEASE-p1 and the available as 12.2-RELEASE-p2. I expected to see the running kernel as 12.2-RELEASE-p2 after reboot. But the output of freebsd-version -urk remains the same. I do not think that this is a serious issue. But this behaviour is unexpected for me.
I should have read that first:
"If several of the above options are specified, freebsd-version will print
the installed kernel version first, then the running kernel version, and
finally the userland version, on separate lines. If neither is speci-
fied, it will print the userland version only."
Both freebsd-version -urk and freebsd-version -kru give the same output and not sorted according to the options. Ten the userland is at 12.2-RELEASE-p2 and the kernel still at 12.2-RELEASE-p1. This clarifies the behaviour.