pkgbasify system failed to fetch

I have a VM with 14.3-RELEASE-p7, and thought I'd try to use pkgbasify with it. I followed the handbook instructions of making a bectl image called 15.0, then mounting it at /mnt/upgrade. In the past I'd had problems with it being unable to find keys but had found the solution when SirDice pointed me to https://www.freebsd.org/releases/15.0R/relnotes/#upgrade-rc, release notes which gave me the solution to get the right key urls. However, this time, it seems the base urls are off.
My /usr/local/etc/pkg/repos/FreeBSD-base.conf reads
FreeBSD-base: { url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_3", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes } (I haven't yet fixed the pkg keys line to see if that was still an issue)
This is what pkgbasify created. So, I tried copying from a machine where I did a successful upgrade. This shows base_release_0 rather than base_release_3.
But even when I do that, when I run, as instructed by the handbook
Code:
env ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base
I get
pkg-static: Repository FreeBSD-base has a wrong packagesite, need to re-create database pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.conf: Not found pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.txz: Not found pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.pkg: Not found pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.tzst: Not found pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.pkg: Not found pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.tzst: Not found Unable to update repository FreeBSD-base Error updating repositories!

Per the handbook's instructions I have already locked pkg in the chroot environment. It does running pkg bootstrap -f is recommended, but I remember from my previous update that worked (in that case, the problem was the keys directory) I didn't do that and had no problems. I'm not sure what I've missed here.
This is a VM and just for experimenting, but I'd like to know what I did wrong.
Per the release information page I did
Code:
cp /usr/src/usr.sbin/pkg/FreeBSD.conf.quarterly-release \
       /etc/pkg/FreeBSD.conf
 
Right, I think that what happens is that pkgbasify kept the 14.3 3, but then, when I try to modify FreeBSD-base.conf to release_0 I still get the error that it's looking for release_3 and I'm not sure what else to change if making FreeBSD-base.conf point to release_0 isn't having an effect.
 
when I try to modify FreeBSD-base.conf to release_0 I still get the error that it's looking for release_3 and I'm not sure what else to change if making FreeBSD-base.conf point to release_0 isn't having an effect.
It must pick up that setting "release_3" from somewhere. Can you post the output of:
env DEBUG_LEVEL=2 ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base

This will indicate what config files are being parsed by pkg.
 
env DEBUG_LEVEL=2 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
DBG(1)[764]> (config) loading repositories in /etc/pkg/
DBG(1)[764]> (config) loading /etc/pkg//FreeBSD.conf
DBG(1)[764]> (config) parsing key 'FreeBSD'
DBG(1)[764]> (config) parsing repository object FreeBSD
DBG(1)[764]> (config) parsing key 'FreeBSD-kmods'
DBG(1)[764]> (config) parsing repository object FreeBSD-kmods
DBG(1)[764]> (config) loading repositories in /usr/local/etc/pkg/repos/
DBG(1)[764]> (config) loading /usr/local/etc/pkg/repos//FreeBSD-base.conf
DBG(1)[764]> (config) parsing key 'FreeBSD-base'
DBG(1)[764]> (config) parsing repository object FreeBSD-base
DBG(1)[764]> (config) loading /usr/local/etc/pkg/repos//FreeBSD.conf
DBG(1)[764]> (config) parsing key 'FreeBSD'
DBG(1)[764]> (config) overwriting repository FreeBSD
DBG(1)[764]> (config) parsing repository object FreeBSD
DBG(1)[764]> (config) parsing key 'FreeBSD-kmods'
DBG(1)[764]> (config) overwriting repository FreeBSD-kmods
DBG(1)[764]> (config) parsing repository object FreeBSD-kmods
pkg-static: Warning: Major OS version upgrade detected. Running "pkg bootstrap -f" recommended
Updating FreeBSD-base repository catalogue...
DBG(1)[764]> PkgRepo: verifying update for FreeBSD-base
pkg-static: Repository FreeBSD-base has a wrong packagesite, need to re-create database
DBG(1)[764]> PkgRepo: need forced update of FreeBSD-base
DBG(1)[764]> Pkgrepo, begin update of '/var/db/pkg/repos/FreeBSD-base/db'
DBG(1)[764]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.conf
DBG(2)[764]> (fetch) curl_open
DBG(1)[764]> (fetch) Fetch: fetcher used: pkg+https
DBG(2)[764]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.conf

pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.conf: Not found
DBG(1)[764]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.txz
DBG(2)[764]> (fetch) curl_open
DBG(1)[764]> (fetch) Fetch: fetcher used: pkg+https
DBG(2)[764]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.txz

pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.txz: Not found
DBG(1)[764]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.pkg
DBG(2)[764]> (fetch) curl_open
DBG(1)[764]> (fetch) Fetch: fetcher used: pkg+https
DBG(2)[764]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.pkg

pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.pkg: Not found
DBG(1)[764]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.tzst
DBG(2)[764]> (fetch) curl_open
DBG(1)[764]> (fetch) Fetch: fetcher used: pkg+https
DBG(2)[764]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.tzst

pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.tzst: Not found
DBG(1)[764]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.pkg
DBG(2)[764]> (fetch) curl_open
DBG(1)[764]> (fetch) Fetch: fetcher used: pkg+https
DBG(2)[764]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.pkg

pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.pkg: Not found
DBG(1)[764]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.tzst
DBG(2)[764]> (fetch) curl_open
DBG(1)[764]> (fetch) Fetch: fetcher used: pkg+https
DBG(2)[764]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.tzst

pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.tzst: Not found
Unable to update repository FreeBSD-base
Error updating repositories!


/usr/local/etc/pkg/repos/FreeBSD-base.conf

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 have a VM with 14.3-RELEASE-p7, and thought I'd try to use pkgbasify with it. I followed the handbook instructions of making a bectl image called 15.0, then mounting it at /mnt/upgrade.
Just to get the context clear for my understanding, you are runing a pkgbasified 14.3-RELEASE and you're attempting to upgrade to a pkgbasified 15.0-RELEASE ?

Also, it looks ok (judging by the posted output), but can you post the contents of /usr/local/etc/pkg/repos/FreeBSD.conf

Edit:
If 15.0-RELEASE is indeed your intended target result, then let's see what's the output of:
env DEBUG_LEVEL=2 OSVERSION=1500068 ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base
 
Erichans yes, I have a 14.3 RELEASE-p7 on a vm that I want to upgrade, via pkgbase, to 15.0 I am doing it as suggested in the handbook, making a boot environment called 15.0-RELEASE, then mounting it on /mnt/upgrade.

The results of env DEBUG requested
env DEBUG_LEVEL=2 OSVERSION=1500068 ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base DBG(1)[769]> (config) loading repositories in /etc/pkg/ DBG(1)[769]> (config) loading /etc/pkg//FreeBSD.conf DBG(1)[769]> (config) parsing key 'FreeBSD' DBG(1)[769]> (config) parsing repository object FreeBSD DBG(1)[769]> (config) parsing key 'FreeBSD-kmods' DBG(1)[769]> (config) parsing repository object FreeBSD-kmods DBG(1)[769]> (config) loading repositories in /usr/local/etc/pkg/repos/ DBG(1)[769]> (config) loading /usr/local/etc/pkg/repos//FreeBSD-base.conf DBG(1)[769]> (config) parsing key 'FreeBSD-base' DBG(1)[769]> (config) parsing repository object FreeBSD-base DBG(1)[769]> (config) loading /usr/local/etc/pkg/repos//FreeBSD.conf DBG(1)[769]> (config) parsing key 'FreeBSD' DBG(1)[769]> (config) overwriting repository FreeBSD DBG(1)[769]> (config) parsing repository object FreeBSD DBG(1)[769]> (config) parsing key 'FreeBSD-kmods' DBG(1)[769]> (config) overwriting repository FreeBSD-kmods DBG(1)[769]> (config) parsing repository object FreeBSD-kmods pkg-static: Warning: Major OS version upgrade detected. Running "pkg bootstrap -f" recommended Updating FreeBSD-base repository catalogue... DBG(1)[769]> PkgRepo: verifying update for FreeBSD-base pkg-static: Repository FreeBSD-base has a wrong packagesite, need to re-create database DBG(1)[769]> PkgRepo: need forced update of FreeBSD-base DBG(1)[769]> Pkgrepo, begin update of '/var/db/pkg/repos/FreeBSD-base/db' DBG(1)[769]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.conf DBG(2)[769]> (fetch) curl_open DBG(1)[769]> (fetch) Fetch: fetcher used: pkg+https DBG(2)[769]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.conf pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.conf: Not found DBG(1)[769]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.txz DBG(2)[769]> (fetch) curl_open DBG(1)[769]> (fetch) Fetch: fetcher used: pkg+https DBG(2)[769]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.txz pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/meta.txz: Not found DBG(1)[769]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.pkg DBG(2)[769]> (fetch) curl_open DBG(1)[769]> (fetch) Fetch: fetcher used: pkg+https DBG(2)[769]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.pkg pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.pkg: Not found DBG(1)[769]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.tzst DBG(2)[769]> (fetch) curl_open DBG(1)[769]> (fetch) Fetch: fetcher used: pkg+https DBG(2)[769]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.tzst pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.tzst: Not found DBG(1)[769]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.pkg DBG(2)[769]> (fetch) curl_open DBG(1)[769]> (fetch) Fetch: fetcher used: pkg+https DBG(2)[769]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.pkg pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.pkg: Not found DBG(1)[769]> (fetch) Request to fetch pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.tzst DBG(2)[769]> (fetch) curl_open DBG(1)[769]> (fetch) Fetch: fetcher used: pkg+https DBG(2)[769]> (fetch) curl> fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.tzst pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/packagesite.tzst: Not found Unable to update repository FreeBSD-base Error updating repositories!

petan
pkg -vv | sed -n '/Repositories:/,$p' Repositories: FreeBSD-ports: { url : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly", enabled : yes, priority : 0, mirror_type : "SRV", signature_type : "FINGERPRINTS", fingerprints : "/usr/share/keys/pkg" } FreeBSD-ports-kmods: { url : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_quarterly_3", enabled : yes, priority : 0, mirror_type : "SRV", signature_type : "FINGERPRINTS", fingerprints : "/usr/share/keys/pkg" } FreeBSD-base: { url : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/base_release_0", enabled : yes, priority : 0, mirror_type : "SRV", signature_type : "FINGERPRINTS", fingerprints : "/usr/share/keys/pkgbase-15" } FreeBSD: { url : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/latest", enabled : yes, priority : 0, mirror_type : "SRV", signature_type : "FINGERPRINTS", fingerprints : "/usr/share/keys/pkg" } FreeBSD-kmods: { url : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_latest_3", enabled : yes, priority : 0, mirror_type : "SRV", signature_type : "FINGERPRINTS", fingerprints : "/usr/share/keys/pkg" }

And I see from that that it's expanding ${ABI}/ to FreeBSD:14 in FreeBSD-base.conf. I'm guessing that the handbook's instructions of
Code:
env ABI=FreeBSD:15:amd64 pkg-static upgrade -r FreeBSD-base

Are supposed to expand it to 15.

My thanks to both of you for taking the time and energy to help.
 
Ok, that looks really helpful. I copied your FreeBSD-base.conf, and did your pkg add -f but still got the same error of
Code:
pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.pkg: Not found

As well as a bunch of other failed to find base_release_3. I think I'm leaving it for tonight, I might just try with a fresh install tomorrow. Again my thanks to everyone helping
 
Ok, that looks really helpful. I copied your FreeBSD-base.conf, and did your pkg add -f but still got the same error of
Code:
pkg-static: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_3/data.pkg: Not found

As well as a bunch of other failed to find base_release_3. I think I'm leaving it for tonight, I might just try with a fresh install tomorrow. Again my thanks to everyone helping
It makes no sense why it's trying to access base_release_3. If you just could get it to fetch base_release_0, I think your fine. :)

Could it be defined in /etc/pkg/?
 
I'll have to check again today. Installing the original VM takes about 5 minutes, so I may start afresh. I agree, I don't know where I've erred to make it look for base_release_3.
 
Ok, I'll have to mark this one solved. I did it again from a fresh install following petan's guide. This time, it saw base_0 and successfully upgraded. Not sure what went wrong last time, but I suspect it was some error of mine that I missed. Thanks again.
 
My /usr/local/etc/pkg/repos/FreeBSD-base.conf reads
FreeBSD-base: { url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_3", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes } (
According to Colin Percival /usr/local/etc/pkg/repos/FreeBSD-base.conf should contain only the enabled line like so:
FreeBSD-base: { enabled: yes }
 
I have 3 installs, one where I upgraded with pkgbase, one where I upgraded with freebsd-update, and one where I did a fresh install. The one upgraded with freebsd-update is exactly as you describe, a FreeBSD-base.conf that reads
FreeBSD-base: { enabled: yes }

The clean install just just has a FreeBSD.conf with
Code:
 FreeBSD-base: { enabled: yes }

The one that was upgraded using pkgbase has the more elaborate FreeBSD-base.conf, that is with the urls, fingerprint, and so on.

But I'd guess that eventually, it's all going to be what you describe.
 
Now, trying on a new test vm, firstly it keeps trying to get base_release_3 and also, once I pkgbasify the system /usr/sbin/pkg complains that some shared objects aren't found.
ldd /usr/sbin/pkg |grep found libcrypto.so.35 => not found (0) libssl.so.35 => not found (0) libutil.so.10 => not found (0) libmd.so.7 => not found (0)

I may just give up on using pkg base from 14-15, especially as I can't find where it's getting that base_3 from. As you can see from my earlier running of
Code:
env DEBUG_LEVEL=2 OSVERSION=1500068 ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base

It seems to be looking at FreeBSD-base.conf but still looking for base_3. I'm guessing I made some obscure error. In contrast, another vm that I updated with FreeBSD update went without a problem. At this point I might just try again with a new VM and try to see what I'm doing wrong, keeping track of all my steps, which I thought I was doing, but I expect I'm not watching closely enough.
 
Is this the new pkg(8) package manager debugging thread 😂

Figure I stop by. I’m running a fresh installation of v15.0 release on bare metal. See FreeBSD Disc Image Writing on Windows 11 Pro

Sourcing community and base system development references, it looks like there were updates for firmware around base system with a new base system installation method. This is good!

See 15.0 release Packaged base system announcement.

This was the method of installation I chose because the missing firmware is breaking my WiFi setup to connect to WiFi.

I may have just traced the root of my WiFi firmware bugs. See Wireless Networking

The fwget(8) command looks helpful will run tests.

Is this causing issues with other versions of FreeBSD

Robert
 
I'd be happy to make it the pkgbasify thread, but it seems I'm the only one having problems. Fortunately, it's on a vm thrown together just to try to learn to use the pkgbasify method.
 
I'd be happy to make it the pkgbasify thread, but it seems I'm the only one having problems. Fortunately, it's on a vm thrown together just to try to learn to use the pkgbasify method.
It looks like we are at the cutting edge of FreeBSD development scottro with pkgbase.

Can someone confirm pkgbasify was updated to pkgbase. Is the developer of pkgbasify in the community forum. See pkgbasify GitHub repository

Big changes in the community. See 2025: Software Development and Infrastructure Support
 
I don't know but if you look up higher in the thread, you'll see user petan's method that worked for him and at least once, worked for me. I *think* (hopefully, someone will correct this if I'm wrong) pkgbase is an option if doing a fresh install of 15. Last time I looked at 16-CURRENT it was also an option but not the default. The pkgbasify script is only for 14.x, maybe just 14.3, a way for early adapters get their 14.x installs to use pkg base. I think there's been a fair amount of discussion about it on Reddit, if you feel like checking there, and also on the mailing lists.


EDIT: See Erichans post , 3 posts below this one. My last sentence about pkgbasify only being for 14.x is wrong.
 
The pkgbasify script is only for 14.x, maybe just 14.3, [...]
No, it isn't.

Running a non-package based FreeBSD 15.0-RELEASE, all it needs to get it set up corrrectly for a packaged base is to enable it. You can do that properly by adding in
/usr/local/etc/pkg/repos/FreeBSD.conf :
Code:
FreeBSD-base: {
    enabled: yes,
}

pkgbasify - FreeeBSD Foundation, on a non-packaged base FreeBSD 15.0-RELEASE just does that: Merely enable FreeBSD-base repo for 15+ - Dec 2, 2025:
Code:
Since FreeBSD 15, /etc/pkg/FreeBSD.conf includes a definition of the
FreeBSD-base repository with all the correct information, it merely
needs to be enabled.
Before this commit, running a non-package based 15.0-RELEASE, pkgbasify didn't execute the transformation properly. Verify that you are using the latest version of pkgbasify.
 
Comparing:
and
I may just give up on using pkg base from 14-15, especially as I can't find where it's getting that base_3 from. As you can see from my earlier running of
env DEBUG_LEVEL=2 OSVERSION=1500068 ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base
It seems to be looking at FreeBSD-base.conf but still looking for base_3.
petan has in his sequence:
Rich (BB code):
# bectl mount 15.0-RELEASE /mnt/upgrade
# env ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade update -r FreeBSD-base
# env ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base
Under normal circumstances, pkg-upgrade(8) does a pkg-update(8) (implicitly) and it works as intended.
pkg-update(8):
Rich (BB code):
DESCRIPTION
       pkg  update is used for updating	the local copy of the repository cata-
       logues from the remote package repository databases.  Updates to	 cata-
       logues  are normally downloaded only when the master copy on the	remote
       package repository is newer than	the local copy.

       The repository catalogues to be updated are defined in the  pkg.conf(5)
       file  or	 by  the entries in /usr/local/etc/pkg/repos.  See pkg.conf(5)
       for details.

       It is best practice to ensure your package repository catalogues	are up
       to date before doing any	package	installation (via  pkg-install(8))  or
       upgrades	 (via pkg-upgrade(8)).	However, explicitly running pkg	update
       is not normally necessary.  By default invoking either of  pkg  install
       or pkg upgrade will cause repository catalogues to be updated automati-
       cally,	unless	 disabled  by  setting	REPO_AUTOUPDATE	 to  false  in
       pkg.conf(5).

However in this case, as shown in petan's code, an explict pkg update ... is issued at its specific BE target. It is likely that this is necessary. Not doing that, will only update the local pkg db, not at its intended mounted BE target directory.

That means that when executing only a pkg-static upgrade, then at its intended BE target uses the old local pkg db, where it still has that 14.3-RELEASE reference.

Let's see what output you get exactly with:
Rich (BB code):
env DEBUG_LEVEL=2 OSVERSION=1500068 ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade update -r FreeBSD-base
env DEBUG_LEVEL=2 OSVERSION=1500068 ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade upgrade -r FreeBSD-base



and also, once I pkgbasify the system /usr/sbin/pkg complains that some shared objects aren't found.
ldd /usr/sbin/pkg |grep found
This is pkg(7), ran on my packaged base FreeBSD 15.0-RELEASE:
Code:
[1-0] # pkg which /usr/sbin/pkg
/usr/sbin/pkg was installed by package FreeBSD-pkg-bootstrap-15.0

Ran on my (non-packaged base) FreeBSD 14.3_RELEASE:
Code:
[2-0] # pkg which /usr/sbin/pkg
/usr/sbin/pkg was not found in the database

What's important wrt pkg-updating and pkg-upgrading is the use of pkg(8):
Code:
[2-0] # pkg which /usr/local/sbin/pkg /usr/local/sbin/pkg-static
/usr/local/sbin/pkg was installed by package pkg-2.5.0
/usr/local/sbin/pkg-static was installed by package pkg-2.5.0

When in a complex process of updating from a non-supported, non-recommend upgrade path from 14.3R (packaged base) to 15.0R (packaged base), it is usually much safer/better to use /usr/local/sbin/pkg-static and not using /usr/local/sbin/pkg, just because pkg(8) does rely on dynamically linked libraries, that may, or may not, have been correctly updated, whilst proceeding with said complex process. And, of course, with pkg-static(8) one has this:
Code:
[3-0] # ldd /usr/local/sbin/pkg-static
ldd: /usr/local/sbin/pkg-static: not a dynamic ELF executable
that is precisely the reason why we are using it in this situation.
 
Back
Top