skill(freebsd): harden pkgbase path — edit existing repo, dry-run first

A pkgbase host already has a FreeBSD-base repo; appending a second block creates
a duplicate repo name (undefined, last-wins). Inspect and EDIT the existing entry
in place (base_release_0 -> base_release_N/base_latest to cross a point release),
then pkg update + pkg upgrade -n (dry run to confirm 15.1 is offered) before the
real pkg upgrade. Also align the pre-status capture with the reference
(freebsd-version -k/-u + uname -r, not -kru).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Sam & Claude 2026-06-25 10:53:42 +02:00
parent 73304e7f41
commit 2ae2481acd

View file

@ -38,11 +38,16 @@ freebsd-version -u # installed userland
uname -r # running kernel
# 2a. pkgbase (base via pkg, e.g. FreeBSD-kernel-generic):
# confirm the base repo points at the TARGET series first — a release-pinned
# repo (base_release_0) only delivers patch levels; base_release_<N> or
# base_latest is what moves you across a point release. Then:
# INSPECT the existing base repo first — a pkgbase host already has one:
pkg -vv | grep -A6 -i 'FreeBSD-base'
grep -rn 'base_release\|base_latest\|FreeBSD-base' /etc/pkg /usr/local/etc/pkg/repos/
# EDIT that existing entry in place (do NOT append a second FreeBSD-base
# block — duplicate repo names give undefined, last-wins behavior). A pinned
# base_release_0 only delivers 15.0 patch levels; change it to base_release_1
# (or base_latest) to cross to 15.1. If it's already base_latest, skip.
pkg update
pkg upgrade # upgrades base AND ports packages together
pkg upgrade -n # DRY RUN first — preview the 15.1 base move, applies nothing
pkg upgrade # apply once the plan looks right (base + ports together)
# 2b. freebsd-update (binary base updates):
freebsd-update -r 15.1-RELEASE upgrade
@ -63,14 +68,18 @@ pkg update -f && pkg upgrade # ports packages (separate from base here)
## Runbook
1. **Capture pre-status** for after-the-fact comparison — see
*Pre-reboot status capture* in the reference (hostname, `freebsd-version
-kru`, services, `jls`, `pfctl -s info`). Record permission-limited checks as
such, not as "down".
*Pre-reboot status capture* in the reference (hostname, `freebsd-version -k`
/ `-u`, `uname -r`, services, `jls`, `pfctl -s info`). Record
permission-limited checks as such, not as "down".
2. **Upgrade base** (by the method from step 0):
- **pkgbase**: confirm the base repo targets the new series first — repoint
`FreeBSD-base` from a pinned `base_release_0` to `base_release_<N>` /
`base_latest` if needed (a pinned release repo only delivers patch levels),
then `pkg update && pkg upgrade` (base + ports together).
- **pkgbase**: a pkgbase host already has a `FreeBSD-base` repo — **inspect
it** (`pkg -vv | grep -A6 -i FreeBSD-base`) and **edit that existing entry
in place**. A pinned `base_release_0` only delivers 15.0 patch levels; point
it at `base_release_<N>` / `base_latest` to cross to the new release. Do
**not** append a second `FreeBSD-base` block — duplicate repo names give
undefined, last-wins behavior. Then `pkg update`, **dry-run** with
`pkg upgrade -n` to confirm 15.1 base packages are actually offered, then
`pkg upgrade` (base + ports together).
- **freebsd-update**: `freebsd-update -r <target> upgrade` then
`freebsd-update install`.
Either way the new kernel is staged; the system runs the old one until reboot.