Briefly
My command line routine, on FreeBSD, includes lines similar to these:
bectl create 20250503-1300
bectl mount 20250503-1300 /tmp/up
/usr/bin/time -h pkg -r /tmp/up upgrade -Fqy -r FreeBSD-base
env BACKUP_LIBRARY_PATH=/tmp/up/usr/local/lib/compat/pkg pkg -r /tmp/up upgrade -qUy -r FreeBSD-base
cp /root/.history /tmp/up/root/.history
history -S
cp /root/.history /tmp/up/root/.history
bectl umount 20250503-1300
bectl activate -t 20250503-1300
Please note, that's not a comprehensive list, not a recipe. (BACKUP_LIBRARIES=true
in pkg.conf(5); the history-related lines suit my use of csh(1) for the root user; and so on.)
Essentially
- never upgrade an active boot environment.
Instead: upgrade a new environment, make the environment temporarily active, boot it. If boot succeeds, then make the active environment non-temporary.
@ericbsd food for thought.
From tests with various versions of FreeBSD, and with GhostBSD, I'm fairly certain that upgrading an active environment is, simply, risky. Doing so in vt, after logging out from a desktop environment, does not negate the risk.