Solved Upgrade from 14.3 to 15.0-RELEASE using pkgbase (wrong packagesite and No trusted public keys found)

Hi, today I tried to update my 14.3-RELEASE-p6 system (already pkgbasified) to 15.0-RELEASE using pkgbase, as per the instructions given in the handbook. Problem is pkg can't update anything, gives
FreeBSD-base has a wrong packagesite, need to re-create database
and
No trusted public keys found
(more detailed problem description later):

Code:
# env ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade update -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.

Current freebsd version:

Code:
# freebsd-version -kru
14.3-RELEASE-p6
14.3-RELEASE-p6
14.3-RELEASE-p6

I created a new boot environment mounted at `/mnt/upgrade` and changed `/usr/local/etc/pkg/repos/FreeBSD-base.conf` to use `base_release_0`.

Code:
# cat /mnt/upgrade/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
}

However updating the repo doesn't work:

Code:
# env ABI=FreeBSD:15:amd64 pkg-static -c /mnt/upgrade -d update -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...
DBG(1)[2974]> PkgRepo: verifying update for FreeBSD-base
pkg-static: Repository FreeBSD-base has a wrong packagesite, need to re-create database
DBG(1)[2974]> PkgRepo: need forced update of FreeBSD-base
DBG(1)[2974]> Pkgrepo, begin update of '/var/db/pkg/repos/FreeBSD-base/db'
DBG(1)[2974]> (fetch) Request to fetch pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/meta.conf
DBG(1)[2974]> (fetch) Fetch: fetcher used: pkg+https
Fetching meta.conf: 100%    179 B   0.2kB/s    00:01
DBG(1)[2974]> (fetch) Request to fetch pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/data.pkg
DBG(1)[2974]> (fetch) Fetch: fetcher used: pkg+https
Fetching data.pkg: 100%   80 KiB  81.6kB/s    00:01
DBG(1)[2974]> PkgRepo: extracting data of repo FreeBSD-base
DBG(1)[2975]> PkgRepo: extracting signature of repo in a sandbox
pkg-static: No trusted public keys found
DBG(1)[2974]> (fetch) Request to fetch pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/packagesite.pkg
DBG(1)[2974]> (fetch) Fetch: fetcher used: pkg+https
FreeBSD-base repository is up to date.
FreeBSD-base is up to date.

Any ideas?
 
My thanks is for the link, I didn't even know there was a handbook section, I only knew of the wiki. I've not yet tried it though.
 
Hi! They have changed the paths for keys in the release. Have a look at https://forums.freebsd.org/threads/convert-15-0-release-to-pkgbase.100491/#post-729451
This is the problem indeed. This is due to a change in FreeBSD infrastructure in November. One should follow the instructions here: https://lists.freebsd.org/archives/freebsd-stable/2025-November/003621.html (For anyone doing this, if you copy the config file directly, remember to set FreeBSD-base enable to yes, because it is not the default yet!)
 
I suspect it would. In the end I pulled in a copy of /usr/share/keys/pkg/pkgbases-15 from a 16.0-RELEASE system (could get it at https://github.com/freebsd/freebsd-src/tree/release/15.0.0/share/keys/pkgbase-15/trusted as well).

Added /usr/local/etc/pkg/repos/FreeBSD-base.conf containing:

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

I then ran:

Code:
env ABI=FreeBSD:15:amd64 OSVERSION=1500000 pkg-static upgrade

and it was successful.

Note that the issue with https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/ still exists - not sure what's up with that, something to do with the CDN maybe?
 
pkgbase 14.3-RELEASE-p6 to 15.0-RELEASE fails here. pkg complains about a missing key but the file is there and readable however, going to https://cloudfront.aws.pkgbase.freebsd.org/FreeBSD:15:amd64/base_release_0/ we get an error re denied access and missing xml file. This is from the link on https://pkg.freebsd.org/FreeBSD:15:amd64/ to base_release_0
I've figured out that Cloudfront is denying listing the contents of that directory. You can still fetch files from it, for example you can fetch https://cloudfront.aws.pkgbase.freebsd.org/FreeBSD:15:amd64/base_release_0/meta
 
hanwen What are your impressions of upgrading from 14.3 to 15.0 release? I have a few systems that I want to upgrade but Im not sure about the path.
  • I have on system at 14.3 pkgbasified. But hesitant to do the upgrade because I not sure about the exact steps. (I have read the handbook).
  • I have a few systems at 14.3 where Im debating if I should do freebsd-update to 15 before pkgbasify.
 
hanwen What are your impressions of upgrading from 14.3 to 15.0 release? I have a few systems that I want to upgrade but Im not sure about the path.
  • I have on system at 14.3 pkgbasified. But hesitant to do the upgrade because I not sure about the exact steps. (I have read the handbook).
  • I have a few systems at 14.3 where Im debating if I should do freebsd-update to 15 before pkgbasify.

For a pkgbasified 14.3, see my comment in this other post: https://forums.freebsd.org/threads/call-for-testing-pkgbase-support-in-15-0.97736/post-729900

For the "traditional" 14.3 I'm sticking with freebsd-update for now. I have just one system using pkgbase to help test things out. As it stands right now, this was the most difficult (as in trying to find proper instructions) major version upgrade I've had to do since FreeBSD 3.5.
 
hanwen What are your impressions of upgrading from 14.3 to 15.0 release? I have a few systems that I want to upgrade but Im not sure about the path.
  • I have on system at 14.3 pkgbasified. But hesitant to do the upgrade because I not sure about the exact steps. (I have read the handbook).
  • I have a few systems at 14.3 where Im debating if I should do freebsd-update to 15 before pkgbasify.
See this for further clarification. For an upgrade path from a pkgbasified 14.3-RELEASE to pkgbasified 15.0-RELEASE (unsupported, not recommended), you may hack your way through, as mentioned above.
 
For the "traditional" 14.3 I'm sticking with freebsd-update for now. I have just one system using pkgbase to help test things out. As it stands right now, this was the most difficult (as in trying to find proper instructions) major version upgrade I've had to do since FreeBSD 3.5.
😂
 
See this for further clarification. For an upgrade path from a pkgbasified 14.3-RELEASE to pkgbasified 15.0-RELEASE (unsupported, not recommended), you may hack your way through, as mentioned above.
Thanks! Well. maybe it was stupid to pkgbasify that one 14.3 system then. I will do a freebsd-upgrade on there other systems. :)
 
Hi everyone.
I just did upgrade and now seeing maybe same/similer issue at FreeBSD-15 ? ` ld-elf.so.1: Shared object "libutil.so.9" not found, required by "pkg" `
# date -u; uname -apKU; freebsd-version -kru
Sun Jan 4 22:59:45 UTC 2015
FreeBSD freebsd 15.0-RELEASE FreeBSD 15.0-RELEASE releng/15.0-n280995-7aedc8de6446 GENERIC amd64 amd64 1500068 1500068
15.0-RELEASE
15.0-RELEASE
15.0-RELEASE

# pkg-static update
pkg-static: Warning: Major OS version upgrade detected. Running "pkg bootstrap -f" recommended
Updating FreeBSD-ports repository catalogue...
pkg-static: An error occurred while fetching package: No error
pkg-static: An error occurred while fetching package: No error
repository FreeBSD-ports has no meta file, using default settings
pkg-static: An error occurred while fetching package: No error
pkg-static: An error occurred while fetching package: No error
pkg-static: An error occurred while fetching package: No error
pkg-static: An error occurred while fetching package: No error
Unable to update repository FreeBSD-ports
Updating FreeBSD-ports-kmods repository catalogue...
pkg-static: An error occurred while fetching package: No error
pkg-static: An error occurred while fetching package: No error
repository FreeBSD-ports-kmods has no meta file, using default settings
pkg-static: An error occurred while fetching package: No error
pkg-static: An error occurred while fetching package: No error
pkg-static: An error occurred while fetching package: No error
pkg-static: An error occurred while fetching package: No error
Unable to update repository FreeBSD-ports-kmods


# pkg bootstrap -f
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly, please wait...
Certificate verification failed for /C=US/O=Internet Security Research Group/CN=ISRG Root X1
10A085CEE2380000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
Certificate verification failed for /C=US/O=Internet Security Research Group/CN=ISRG Root X1
10A085CEE2380000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
Certificate verification failed for /C=US/O=Internet Security Research Group/CN=ISRG Root X1
10A085CEE2380000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
pkg: Error fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly/Latest/pkg.pkg: Authentication error
A pre-built version of pkg could not be found for your system.
Bootstrapping pkg from pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/kmods_quarterly_0, please wait...
Certificate verification failed for /C=US/O=Internet Security Research Group/CN=ISRG Root X1
10A085CEE2380000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
Certificate verification failed for /C=US/O=Internet Security Research Group/CN=ISRG Root X1
10A085CEE2380000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
Certificate verification failed for /C=US/O=Internet Security Research Group/CN=ISRG Root X1
10A085CEE2380000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:/usr/src/crypto/openssl/ssl/statem/statem_clnt.c:2124:
pkg: Error fetching https://pkg.FreeBSD.org/FreeBSD:15:amd64/kmods_quarterly_0/Latest/pkg.pkg: Authentication error
A pre-built version of pkg could not be found for your system.




Where im doing wrong ? Thank you

Shahin
 
I have already been using pkgbase for a long time on my 14.3.
Do I still need to pkgbasify the system before upgrading to 15.0?
Or I just follow the steps on wiki/pkgbase?
 
See this for further clarification. For an upgrade path from a pkgbasified 14.3-RELEASE to pkgbasified 15.0-RELEASE (unsupported, not recommended), you may hack your way through, as mentioned above.
Ok, I performed this upgrade tonight. At least for now it seems to work. The path I followed was:

# cat /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/pkgbase-15",
enabled: yes
}

# pkg add -f https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0/FreeBSD-pkg-bootstrap-15.0.pkg

# bectl create 15.0-RELEASE
# mkdir /mnt/upgrade
# 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
# chroot /mnt/upgrade
# freebsd-version -ku
15.0-RELEASE
15.0-RELEASE
# bectl activate -t 15.0-RELEASE
# reboot


I also got a few packages orphaned from 14.3 pkgbase. But I couldn't see anything I really need so I just deinstalled them and for now everything seems to work fine.


# pkg-static -c /mnt/upgrade info | grep 14.3p6
pkg-static: Warning: Major OS version upgrade detected. Running "pkg bootstrap -f" recommended
FreeBSD-dpv-14.3p6 dpv package
FreeBSD-dpv-dev-14.3p6 dpv package (Development Files)
FreeBSD-dpv-dev-lib32-14.3p6 dpv-dev package (32-bit Libraries)
FreeBSD-dpv-lib32-14.3p6 dpv package (32-bit Libraries)
FreeBSD-dpv-man-14.3p6 dpv package (Manual Pages)
FreeBSD-efi-tools-dev-lib32-14.3p6 efi-tools-dev package (32-bit Libraries)
FreeBSD-efi-tools-lib32-14.3p6 UEFI Utilities (32-bit Libraries)
FreeBSD-ftpd-14.3p6 FTP Daemon
FreeBSD-ftpd-man-14.3p6 FTP Daemon (Manual Pages)
FreeBSD-liby-dev-14.3p6 liby package (Development Files)
FreeBSD-liby-dev-lib32-14.3p6 liby-dev package (32-bit Libraries)
FreeBSD-openssl-lib-lib32-14.3p6 OpenSSL Libraries (32-bit Libraries)
FreeBSD-openssl-lib-man-14.3p6 OpenSSL Libraries (Manual Pages)
FreeBSD-pkg-bootstrap-man-14.3p6 pkg bootstrap Utility (Manual Pages)
FreeBSD-sendmail-dev-14.3p6 Sendmail Utilities (Development Files)
FreeBSD-sendmail-dev-lib32-14.3p6 sendmail-dev package (32-bit Libraries)
FreeBSD-sendmail-lib32-14.3p6 Sendmail Utilities (32-bit Libraries)
FreeBSD-tests-man-14.3p6 Test Suite (Manual Pages)
FreeBSD-unbound-14.3p6 Unbound DNS Resolver
FreeBSD-unbound-dev-14.3p6 Unbound DNS Resolver (Development Files)
FreeBSD-unbound-dev-lib32-14.3p6 unbound-dev package (32-bit Libraries)
FreeBSD-unbound-lib32-14.3p6 Unbound DNS Resolver (32-bit Libraries)
FreeBSD-unbound-man-14.3p6 Unbound DNS Resolver (Manual Pages)

# pkg remove <pkgs>
 
Great, I see you used ZFS to your advantage. Good to see that with that "pkg-bootstrap" package you got your 15.0-RELEASE keys in order and working.

There may be other packages with the string "14.3", i.e. not specifically refering to p6 (I haven't run a packaged base 14.x though).
Either way, I cannot think of any particular reason to keep those around.
 
I also got a few packages orphaned from 14.3 pkgbase. But I couldn't see anything I really need so I just deinstalled them and for now everything seems to work fine
You didn't mention any specifics wrt to the rest of the 15.0 base packages. What I would have tried (when having upgrade from a package based 14.3 environment) when running the on a 15.0-RELEASE kernel is pkg upgrade -r FreeBSD-base perhaps even with a -f.

On my packaged base 15.0-RELEASE, I have:
Code:
[1-0] # pkg query -e '%o~base/*' '[%R] %v %o %n' | wc
     496    1984   32386
[2-0] # pkg query -e '%o~base/*' '[%R] %v %o %n' | head |column -t
[FreeBSD-base]  15.0  base/FreeBSD-acct      FreeBSD-acct
[FreeBSD-base]  15.0  base/FreeBSD-acct-dbg  FreeBSD-acct-dbg
[FreeBSD-base]  15.0  base/FreeBSD-acpi      FreeBSD-acpi
[FreeBSD-base]  15.0  base/FreeBSD-acpi-dbg  FreeBSD-acpi-dbg
[FreeBSD-base]  15.0  base/FreeBSD-apm       FreeBSD-apm
[FreeBSD-base]  15.0  base/FreeBSD-apm-dbg   FreeBSD-apm-dbg
[FreeBSD-base]  15.0  base/FreeBSD-at        FreeBSD-at
[FreeBSD-base]  15.0  base/FreeBSD-at-dbg    FreeBSD-at-dbg
[FreeBSD-base]  15.0  base/FreeBSD-atf       FreeBSD-atf
[FreeBSD-base]  15.0  base/FreeBSD-atf-dbg   FreeBSD-atf-dbg
 
when running the on a 15.0-RELEASE kernel is pkg upgrade -r FreeBSD-base perhaps even with a -f.
Yep, I ranpkg upgrade -r FreeBSD-base but maybe I should run it with -f.

I actually found something that didn't work as expected. The man-command was missing. So I had to:
Rich (BB code):
# pkg install -f FreeBSD-mandoc-15.0
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
All repositories are up to date.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    FreeBSD-ctf: 15.0 [FreeBSD-base]
    FreeBSD-mandoc: 15.0 [FreeBSD-base]
    FreeBSD-xz: 15.0 [FreeBSD-base]

Number of packages to be installed: 3

300 KiB to be downloaded.

Proceed with this action? [y/N]: y
 
There may be other packages with the string "14.3"
pkg query -e '%o~base/*' '%v %n' | sed '/^15\.0/d' | cut -d ' ' -f 2 should print all non 15.0-RELEASE packages.

Yep, I ranpkg upgrade -r FreeBSD-base but maybe I should run it with -f.
A 15.0 packaged base has package sets:
Code:
[1-0] # pkg alias |gi sets
sets                 'info -d -C -x '^FreeBSD-set-''
A packaged based 14.x doesn't have these. I havent explored these really.

As an ultimate test I think you might opt for some comparison of your installed base packages with those that are available, perhaps use:
pkg rquery -r FreeBSD-base -e '%o~base/*' '%v %n'* as a basis for a diff.

___
* Edit: P.S. here -e '%o~base/*' is redundant, but not when using pkg-query(8)
 
The general solution might be
Rich (BB code):
# pkg install FreeBSD-set-base
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
All repositories are up to date.
The following 41 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    FreeBSD-atf: 15.0 [FreeBSD-base]
    FreeBSD-atf-dev: 15.0 [FreeBSD-base]
    FreeBSD-audit: 15.0 [FreeBSD-base]
    FreeBSD-audit-dev: 15.0 [FreeBSD-base]
    FreeBSD-bzip2-dev: 15.0 [FreeBSD-base]
    FreeBSD-ctf-dev: 15.0 [FreeBSD-base]
    FreeBSD-ctl: 15.0 [FreeBSD-base]
    FreeBSD-diff3: 15.0 [FreeBSD-base]
    FreeBSD-examples: 15.0 [FreeBSD-base]
    FreeBSD-fd: 15.0 [FreeBSD-base]
    FreeBSD-firmware-iwm: 15.0 [FreeBSD-base]
    FreeBSD-flua-dev: 15.0 [FreeBSD-base]
    FreeBSD-gssd: 15.0 [FreeBSD-base]
    FreeBSD-kerberos-dev: 15.0 [FreeBSD-base]
    FreeBSD-kerberos-kdc: 15.0 [FreeBSD-base]
    FreeBSD-kernel-man: 15.0 [FreeBSD-base]
    FreeBSD-kyua: 15.0 [FreeBSD-base]
    FreeBSD-libmilter: 15.0 [FreeBSD-base]
    FreeBSD-libmilter-dev: 15.0 [FreeBSD-base]
    FreeBSD-libyaml-dev: 15.0 [FreeBSD-base]
    FreeBSD-lldb-dev: 15.0 [FreeBSD-base]
    FreeBSD-local-unbound: 15.0 [FreeBSD-base]
    FreeBSD-local-unbound-dev: 15.0 [FreeBSD-base]
    FreeBSD-lp: 15.0 [FreeBSD-base]
    FreeBSD-ncurses-dev: 15.0 [FreeBSD-base]
    FreeBSD-ntp: 15.0 [FreeBSD-base]
    FreeBSD-openssl-dev: 15.0 [FreeBSD-base]
    FreeBSD-pmc: 15.0 [FreeBSD-base]
    FreeBSD-pmc-dev: 15.0 [FreeBSD-base]
    FreeBSD-powerd: 15.0 [FreeBSD-base]
    FreeBSD-rip: 15.0 [FreeBSD-base]
    FreeBSD-set-base: 15.0 [FreeBSD-base]
    FreeBSD-set-devel: 15.0 [FreeBSD-base]
    FreeBSD-set-minimal: 15.0 [FreeBSD-base]
    FreeBSD-set-optional: 15.0 [FreeBSD-base]
    FreeBSD-sound: 15.0 [FreeBSD-base]
    FreeBSD-sound-dev: 15.0 [FreeBSD-base]
    FreeBSD-toolchain: 15.0 [FreeBSD-base]
    FreeBSD-toolchain-dev: 15.0 [FreeBSD-base]
    FreeBSD-xz-dev: 15.0 [FreeBSD-base]
    FreeBSD-zlib-dev: 15.0 [FreeBSD-base]
 
Back
Top