Solved Can't update (error in FreeBSD-base.conf?)

I have a pkgbasifyed 14.3-p6 system. I tried to upgrade following the handbook. https://docs.freebsd.org/en/books/handbook/cutting-edge/#pkgbase-major-zfs
My /usr/local/etc/pkg/repos/FreeBSD-base.conf reads

Code:
FreeBSD-base: {
  url = "pkg+https://pkg.freebsd.org/${ABI}/base_release_0";
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}

I created a 15.0-RELEASE boot environment, created a /mnt/update directory, and mounted the boot environment with
bectl mount 15.0-RELEASE /mnt/upgrade

I then ran
env ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base
The result was

Code:
env ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base
pkg-static: Setting ABI requires setting OSVERSION, guessing the OSVERSION as: 1500000
pkg-static: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
Updating FreeBSD-base repository catalogue...
pkg-static: Repository FreeBSD-base has a wrong packagesite, need to re-create database
Fetching meta.conf: 100%    179 B   0.2kB/s    00:01
Fetching data.pkg: 100%   80 KiB  81.6kB/s    00:01
pkg-static: No trusted public keys found
FreeBSD-base repository is up to date.
FreeBSD-base is up to date.
pkg-static: Repository FreeBSD-base has a wrong packagesite, need to re-create database
pkg-static: Repository FreeBSD-base cannot be opened. 'pkg update' required
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

I'm not sure of the error. Should I run pkg bootstrap -f as suggested? Is the trouble with no trusted keys found, and if so, what should I change to get trusted keys?

The handbook says after this, chroot and run freebsd-version--unsurprisingly it was still at 14.3 So, I'm not sure what needs to be changed here.

Thanks for any input. I have read various threads on upgrading and have seen some, but not all, need to change the fingerprint url, but I'm not sure of what to do next.

I think the next step is pkg bootstrap, but thought I'd ask first, as I *vaguely* remember someone saying don't do that, though I can't find the post and don't know if it's applicable to my situation or not.
 
That fixed it, thank you. I ran
Code:
cp -R /usr/src/share/keys/pkgbase-15 /usr/share/keys/pkgbase-15
. I then edited
/usr/local/etc/pkg/repos/FreeBSD-base.conf so that that the fingerprints line read
Code:
fingerprints: "/usr/share/keys/pkgbase-15",
and ran the line the handbook suggests, the
Code:
env ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base
.
Then, after continuing to follow the handbook and doing a chroot into /mnt/upgrade, it showed that it was running FreeBSD-15.0-RELEASE.

I did note that the upgrade seems to have changed the fingerprints line back to /usr/share/keys/pkg, but I can worry about that in the future, or perhaps that will be the future location.

Thanks very much. I'd managed to get myself completely confused about what to do about fingerprint location.
 
What might have interfered with your upgrade attempts from a pkgbasified 14.3-R to a pkgbasified 15.0-R is the use of a separate FreeBSD-base.conf, but I'm guessing here. AFAIK, FreeBSD-base.conf is what was adviced when a package base was introduced as experimental on FreeBSD 14.2-3. I have not experienced these fingerprints/keys problems as I started from a 14.2-RELEASE non-pkgbasified using freebsd-update(8) and upgraded my pkgbasified 15.0-BETAx etc. with every new release during the pre-release cycle into 15.0-RELEASE.

There have been late-breaking changes that resulted in problems wrt the fingerprint-key problems you encountered and have now resolved for your particular situation. It seems that Colin Percival had clearly planned things differently: HEADS UP: pkgbase breakage 15.0-{PRERELEASE,ALPHA*,BETA*} - 27 Nov 2025; some more info by Gordon Tetlow in pkgbase repo signing infrastructure - 30 Nov 2025. These are relevant wrt these issues, but please consider a wider context than just these two messages. I hope any future changes will be less bumpy.

Using a /usr/local/etc/pkg/repos/FreeBSD-base.conf can easily lead to confusion, despite the fact that this a acceptable and correctly working file name. When using this particular local file, the main three configuration files that a user can be affected by, for example when running a packaged base 15 and latest, are:
  1. /etc/pkg/FreeBSD.conf
  2. /usr/local/etc/pkg/repos/FreeBSD.conf
  3. /usr/local/etc/pkg/repos/FreeBSD-base.conf
Again, these constitute a correct set of files--but requires correct settings and should be maintained carefully. I've seen it often that users are experiencing difficulties in knowing what to change and where. This can easily lead to misaligned configuration settings: for example mixing quarterly and latest config settings for FreeBSD-ports and FreeBSD-ports-kmods, and still having a hard-coded 3 in "pkg+https://pkgbase.FreeBSD.org/${ABI}/base_release_3", (I expect as part of the leftovers from a pkgbasified FreeBSD 14), in addition to using pkgbase.FreeBSD.org. Using something like pkg -vv | sed -nE -e '/(OSVERSION|^ABI|BACKUP)/ p' -e '/^Repositories:/,$ p' provides me a lot of information about the settings pkg(8) is actually using, as it parses* all pkg configuration files and any accompanying command line OPTION settings passed by using -o parameters and passed by env(1) in combination with pkg(8); see: pkg.conf(5).

I consider the Handbook at this moment a work in progress—as I believe you do as well. There are a lot of Warning notices, such as 26.7.2. Upgrading a Host using freebsd-base that emphasize its status. AFAIK, most of the text relating to a packged base FreeBSD 15.0 was written sometime before the completion of the 15.0-BETAx and 15.0-RCy series. Things changed during the run of those versions, notably wrt to package based operation.

___
* pkg parses all of these in two separate passes: pkg.conf(5)
 
Back
Top