freebsd-update may print something like this: > To install the downloaded upgrades, run "/usr/sbin/freebsd-update install". or > Kernel updates have been installed. Please reboot and run > "/usr/sbin/freebsd-update install" again to finish installing updates. Morespecifically, these: > $ grep -e '\$0' /usr/sbin/freebsd-update | grep -v basename > echo "Run '$0 install' first." > echo "Run '$0 fetch -F' to proceed anyway." > echo "Run '$0 fetch' first." > echo "Re-run '$0 fetch'." > before running "$0 install". > echo "To install the downloaded upgrades, run \"$0 install\"." > echo "Re-run '$0 fetch'." > "$0 install" again to finish installing updates. > installed from the ports tree) and then run "$0 install" > echo "Run '$0 install' to proceed." The problem with these recommendations is that if freebsd-update is started with options (e.g., -b, -f, etc.) the copied and pasted recommendationd lead to incorrect or even broken results. Consider running: > freebsd-update -j deblndw013x4v2j -d $(jls -j deblndw013x4v2j -h path | tail -1)/var/db/freebsd-update -f $(jls -j deblndw013x4v2j -h path | tail -1)/etc/freebsd-update.conf -r 13.2-RELEASE upgrade then > freebsd-update install as next command would be wrong. This might be nit-picking, but not straight forward for some people. It should either completely replicate the command input or describe rather in prose rather can providing a copiable command.
The longer-term strategy for updates is a migration to pkgbase (in 15.0 and later), but improvements for 14/13 would be welcome. Michael are you interested in proposing a patch?
(In reply to Ed Maste from comment #1) Yes, I'll work on a patch next week. I think it is still worthwhile even in main since long-term does not mean that pkgbase will replace freebsd-update in 15 ATM. It might live side by side.
A review is in the works...
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=59b02bb420e3b0a49af39f7817764ca444f7c793 commit 59b02bb420e3b0a49af39f7817764ca444f7c793 Author: Michael Osipov <michaelo@FreeBSD.org> AuthorDate: 2024-01-30 16:24:45 +0000 Commit: Michael Osipov <michaelo@FreeBSD.org> CommitDate: 2024-03-18 09:33:42 +0000 freebsd-update: Don't provide copiable commands in output Previously, freebsd-update provided ready-to-go commands for copying and pasting into the terminal. This causes problems as soon as options are used and not supplied again by the user, e.g., '-b' or '-d'. Stop making them copiable and force the user to construct a valid command line by himself to avoid failures. PR: 276102 Approved by: jrm (mentor), emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D43700 usr.sbin/freebsd-update/freebsd-update.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=69dbc448cf8b3677e783353bcc0c2108b8a74b9d commit 69dbc448cf8b3677e783353bcc0c2108b8a74b9d Author: Michael Osipov <michaelo@FreeBSD.org> AuthorDate: 2024-01-30 16:24:45 +0000 Commit: Michael Osipov <michaelo@FreeBSD.org> CommitDate: 2024-04-17 06:50:07 +0000 freebsd-update: Don't provide copiable commands in output Previously, freebsd-update provided ready-to-go commands for copying and pasting into the terminal. This causes problems as soon as options are used and not supplied again by the user, e.g., '-b' or '-d'. Stop making them copiable and force the user to construct a valid command line by himself to avoid failures. PR: 276102 Approved by: jrm (mentor), emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D43700 usr.sbin/freebsd-update/freebsd-update.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d596e573119e245b2d2b53afeb523700510e5bf2 commit d596e573119e245b2d2b53afeb523700510e5bf2 Author: Michael Osipov <michaelo@FreeBSD.org> AuthorDate: 2024-01-30 16:24:45 +0000 Commit: Michael Osipov <michaelo@FreeBSD.org> CommitDate: 2024-04-17 06:51:38 +0000 freebsd-update: Don't provide copiable commands in output Previously, freebsd-update provided ready-to-go commands for copying and pasting into the terminal. This causes problems as soon as options are used and not supplied again by the user, e.g., '-b' or '-d'. Stop making them copiable and force the user to construct a valid command line by himself to avoid failures. PR: 276102 Approved by: jrm (mentor), emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D43700 usr.sbin/freebsd-update/freebsd-update.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)