Solved Convert 15.0-RELEASE to pkgbase

Hi!

I have a system recently updated to 15.0 using traditional freebsd-update. And now I want to convert it to use pkgbase.

# uname -a
FreeBSD hyper15.0-RELEASE FreeBSD 15.0-RELEASE releng/15.0-n280995-7aedc8de6446 GENERIC amd64


that's nice and everything but when I try to use pkgbasify.lua I run in to this problem:

# ./pkgbasify.lua
Running this tool will irreversibly modify your system to use pkgbase.
This tool and pkgbase are experimental and may result in a broken system.
It is highly recommended to backup your system before proceeding.
Do you accept this risk and wish to continue? (y/n) y
Updating FreeBSD-base repository catalogue...
Fetching meta.conf: 100% 179 B 0.2kB/s 00:01
Fetching data.pkg: 100% 80 KiB 81.6kB/s 00:01
pkg: No trusted public keys found
FreeBSD-base repository is up to date.
All repositories are up to date.
/usr/libexec/flua: ./pkgbasify.lua:28: exit
stack traceback:
[C]: in function 'assert'
./pkgbasify.lua:28: in upvalue 'capture'
./pkgbasify.lua:212: in upvalue 'rquery_osversion'
./pkgbasify.lua:231: in upvalue 'confirm_version_compatibility'
./pkgbasify.lua:363: in upvalue 'setup_conversion'
./pkgbasify.lua:541: in local 'main'
./pkgbasify.lua:554: in main chunk
[C]: in ?


As far as I can tell I have the same keys as the distribution-files.

# ls /usr/share/keys/pkgbase-15/trusted/
awskms-15 backup-signing-15
 
Please post the output of
pkg -vv | sed -nE -e '/^OSVERSION|^ABI/ p' -e '/^Repositories:/,$ p'
# pkg -vv | sed -nE -e '/^OSVERSION|^ABI/ p' -e '/^Repositories:/,$ p'
ABI = "FreeBSD:15:amd64";
OSVERSION = "1500068";
Repositories:
FreeBSD-ports: {
url : "pkg+https://pkg.FreeBSD.org/FreeBSD:15: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:15:amd64/kmods_quarterly_0",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-base: {
url : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_0",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkgbase-15"
}
 
Right, I have used pkgbasify at 15.0-BETAx; I've succesfully used pkg upgrade to the unofficial 15.0-RELEASE atm; my situation therefore is not quite the same.

You might have been impacted by the changes that haven been made wrt the FreeBSD-base configuration settings. I'm not particularly knowledgable in the area of the usage of keys, however, looking at pkgbasify.lua#L84-L96:
Rich (BB code):
local function create_base_repo_conf(path)
    assert(os.execute("mkdir -p " .. path:match(".*/")))
    local f <close> = assert(io.open(path, "w"))
    assert(f:write(string.format([[
%s: {
  url: "%s",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
]], options.repo_name, base_repo_url())))
end
you might consider changing the fingerprints value in your pkgbasify script to the one you got as shown in your output.

Edit: After rerunning pkgbasify IF successful (it seems it was!), verify that the fingerprints values for FreeBSD-ports and FreeBSD-ports-kmods repositories have remained the same as shown in your output.
 
Right, I have used pkgbasify at 15.0-BETAx; I've succesfully used pkg upgrade to the unofficial 15.0-RELEASE atm; my situation therefore is not quite the same.

You might have been impacted by the changes that haven been made wrt the FreeBSD-base configuration settings. I'm not particularly knowledgable in the area of the usage of keys, however, looking at pkgbasify.lua#L84-L96:
Rich (BB code):
local function create_base_repo_conf(path)
    assert(os.execute("mkdir -p " .. path:match(".*/")))
    local f <close> = assert(io.open(path, "w"))
    assert(f:write(string.format([[
%s: {
  url: "%s",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
]], options.repo_name, base_repo_url())))
end
you might consider changing the fingerprints value in your pkgbasify script to the one you got as shown in your output.
That solved it for me! Thanks!
 
That solved it for me! Thanks!
After having run pkgbasify (to get to a packaged base) verify that you have, as it is intented for the release version, for /etc/pkg/FreeBSD.conf:
Code:
[1-0] % cat /etc/pkg/FreeBSD.conf
#
# To disable a repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file, e.g.:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD-ports: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#   echo "FreeBSD-ports-kmods: { enabled: no }" >> /usr/local/etc/pkg/repos/FreeBSD.conf
#
# Note that the FreeBSD-base repository is disabled by default.
#

FreeBSD-ports: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
FreeBSD-ports-kmods: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
FreeBSD-base: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_${VERSION_MINOR}",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: no
}
[2-0] %
See FreeBSD.conf.quarterly-release - releng/15; then enable the FreeBSD-base repository in your locally defined .conf file.

Atm it looks like pkgbasify still creates a seperate /usr/local/etc/pkg/repos/FreeBSD-base.conf; that's probably what you have at the moment. pkgbasify.lua#L12-L20:
Rich (BB code):
local options = {
	create_repo_conf = true,
	repo_name = "FreeBSD-base"
}

local repo_conf_dir <const> = "/usr/local/etc/pkg/repos/"
local function repo_conf_file()
	return repo_conf_dir .. options.repo_name .. ".conf"
end

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

is acceptable and works. However, you may prefer having all your local settings in one locally defined config file; I do.
The pkg -vv "partially parses" all pkg .conf files and thus you see the expanded variables in the output; this represents the settings that are "active".
 
Note pkgbasify - Commit 8ff18af - as of Dec 2, 2025, 4:34 PM GMT+1:
Merely enable FreeBSD-base repo for 15+

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.

That means if you have installed 15.0-RELEASE based the traditional dist-sets, and want to switch to a packaged base afterwards, running pkgbasify should suffice.
 
Back
Top