Re: An odd vital FreeBSD-set-* result?

From: Mark Millard <marklmi_at_yahoo.com>
Date: Fri, 19 Sep 2025 17:18:07 UTC
On Sep 19, 2025, at 08:48, Lexi Winter <ivy@freebsd.org> wrote:
> 
> Mark Millard wrote in <780BB42C-1EBE-4847-ADE6-F8F6730617B8@yahoo.com>:
>> # pkg-static install    -U -rFreeBSD-base -g 'FreeBSD-*'
>> 
>> Afterwards I tried deleting FreeBSD-set-* without force
>> being requested and it reported only 4 as vital and
>> allowed the others to be deleted:
> 
> are you able to reproduce this on a clean system (e.g., in a chroot)?
> if so, the particular sequence of commands that triggers it would be
> useful to have.

I think the below means I do not need to do this: the *.pkg files
agree with the "only 4" status.

> also, please show the output of this command on the affected system:
> 
> pkg info | awk '/^FreeBSD-set-/ { print $1 }' | xargs pkg query '%n %V'

Unfortunately since the deletes happened, the FreeBSD-set-* in
question are no longer listed in the info output.

Similarly for my later having forcing the delete of the 4 that did
report being vital.

So, overall: empty output on both systems.

But the following indicates that the cached *.pkg files themselves
agree with the just-4-vitals status:

amd64:

 # find -s /var/cache/pkg/ -name "FreeBSD-set*~*.pkg" -exec pkg info -R -F {} \; | grep -e name: -e vital:
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
name: "FreeBSD-set-base"
vital: true
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-base-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-devel"
vital: true
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-devel-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-kernels"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-kernels-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-lib32"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-lib32-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-minimal"
vital: true
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-minimal-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-minimal-jail"
vital: true
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-minimal-jail-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-src"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-tests"


aarch64:

# find -s /var/cache/pkg/ -name "FreeBSD-set*~*.pkg" -exec pkg info -R -F {} \; | grep -e name: -e vital:
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
name: "FreeBSD-set-base"
vital: true
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-base-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-devel"
vital: true
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-devel-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-kernels"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-kernels-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-lib32"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-lib32-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-minimal"
vital: true
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-minimal-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-minimal-jail"
vital: true
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-minimal-jail-dbg"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-src"
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
}name: "FreeBSD-set-tests"

Also of note is the lack of a new-line between the prior } and the
name: for most of the above. An example of a surrounding context is:

categories: [
    "base"
]
annotations: {
    FreeBSD_version: "1600000"
}name: "FreeBSD-set-base-dbg"
origin: "base"


The example also showing the lack of vital: for lib32 is:

. . .
categories: [
    "base"
]
annotations: {
    FreeBSD_version: "1600000"
}name: "FreeBSD-set-lib32"
origin: "base"
version: "16.snap20250912212418"
comment: "32-bit compatibility libraries (metapackage)"
maintainer: "re@FreeBSD.org"
www: "https://www.FreeBSD.org"
abi: "FreeBSD:16:aarch64"
arch: "freebsd:16:aarch64:64"
prefix: "/"
flatsize: 0
licenselogic: "single"
licenses: [
    "BSD2CLAUSE"
]
desc: "This metapackage installs compatibility libraries required for building and\nrunning 32-bit applications on a 64-bit host system."
. . .

(When listed, vital: is the line just before "desc:".)

So the problem appears to have been from upstream.

For reference, amd64:

/var/cache/pkg/FreeBSD-set-base-16.snap20250918100450.pkg
/var/cache/pkg/FreeBSD-set-base-16.snap20250918100450~c89aadaed9.pkg
/var/cache/pkg/FreeBSD-set-base-dbg-16.snap20250918100450.pkg
/var/cache/pkg/FreeBSD-set-base-dbg-16.snap20250918100450~d584303e89.pkg
/var/cache/pkg/FreeBSD-set-devel-16.snap20250918100450.pkg
/var/cache/pkg/FreeBSD-set-devel-16.snap20250918100450~afeee71eda.pkg
/var/cache/pkg/FreeBSD-set-devel-dbg-16.snap20250912210739.pkg
/var/cache/pkg/FreeBSD-set-devel-dbg-16.snap20250912210739~94132e3b9c.pkg
/var/cache/pkg/FreeBSD-set-kernels-16.snap20250917214757.pkg
/var/cache/pkg/FreeBSD-set-kernels-16.snap20250917214757~cd5edfd16f.pkg
/var/cache/pkg/FreeBSD-set-kernels-dbg-16.snap20250912210739.pkg
/var/cache/pkg/FreeBSD-set-kernels-dbg-16.snap20250912210739~d150e3cf2e.pkg
/var/cache/pkg/FreeBSD-set-lib32-16.snap20250912210739.pkg
/var/cache/pkg/FreeBSD-set-lib32-16.snap20250912210739~01dd34d6a9.pkg
/var/cache/pkg/FreeBSD-set-lib32-dbg-16.snap20250912210739.pkg
/var/cache/pkg/FreeBSD-set-lib32-dbg-16.snap20250912210739~6bf2e897c8.pkg
/var/cache/pkg/FreeBSD-set-minimal-16.snap20250918100450.pkg
/var/cache/pkg/FreeBSD-set-minimal-16.snap20250918100450~d5a6a3a3cb.pkg
/var/cache/pkg/FreeBSD-set-minimal-dbg-16.snap20250918100450.pkg
/var/cache/pkg/FreeBSD-set-minimal-dbg-16.snap20250918100450~a9dbb207b2.pkg
/var/cache/pkg/FreeBSD-set-minimal-jail-16.snap20250917214757.pkg
/var/cache/pkg/FreeBSD-set-minimal-jail-16.snap20250917214757~3e33cdaaf4.pkg
/var/cache/pkg/FreeBSD-set-minimal-jail-dbg-16.snap20250917214757.pkg
/var/cache/pkg/FreeBSD-set-minimal-jail-dbg-16.snap20250917214757~74d0186d0e.pkg
/var/cache/pkg/FreeBSD-set-src-16.snap20250916221226.pkg
/var/cache/pkg/FreeBSD-set-src-16.snap20250916221226~cfde358ad0.pkg
/var/cache/pkg/FreeBSD-set-tests-16.snap20250916221226.pkg
/var/cache/pkg/FreeBSD-set-tests-16.snap20250916221226~7620158652.pkg

> i've tested this here and even if FreeBSD-set-src isn't marked as vital
> prior to the upgrade, it becomes vital after updating, which seems to be
> the expected behaviour from a quick inspection of the pkg(8) source.

It appears that what happend in my environment matches the materials
downloaded from upstream. It seems upstream is what needs the
investigation.

Again, I wonder if the /usr/src/ downloaded did not match what was
actually built and downloaded.

For reference, amd64 context:

/var/cache/pkg/FreeBSD-src-16.snap20250918100450.pkg
/var/cache/pkg/FreeBSD-src-16.snap20250918100450~1656b05fd3.pkg
/var/cache/pkg/FreeBSD-src-sys-16.snap20250918100450.pkg
/var/cache/pkg/FreeBSD-src-sys-16.snap20250918100450~c6577afa66.pkg



Side Note:

Looking around I do see an oddity in /var/db/pkg/ :

# ls -C1 /var/db/pkg/*-15.*.pkg | wc -l
     840

Those *.pkg files have (local) date/times that are rather old:

lrwxr-xr-x   1 root wheel uarch        65 Jan 25 23:51:43 2025 /var/db/pkg/FreeBSD-libsqlite3-dbg-lib32-15.snap20250123224330.pkg -> FreeBSD-libsqlite3-dbg-lib32-15.snap20250123224330~ab7a13a036.pkg
. . .
-rw-r--r--   1 root wheel uarch     13161 Dec  8 13:22:05 2024 /var/db/pkg/FreeBSD-libmagic-man-15.snap20241208191210~5c9a803aa3.pkg

# ls -C1 /var/db/pkg/*-16.*.pkg | wc -l
ls: /var/db/pkg/*-16.*.pkg: No such file or directory
       0

Looks to me like I should delete these old *.pkg files
from /var/db/pkg/ .

===
Mark Millard
marklmi at yahoo.com