Thigs went so smoothly, i thought i go for gold and build a Pkgbase update server from vermadens pkgbase update server blog
Skipped some parts with the ZFS
Warning!! TL;DR: my first few attempts to upgrade bork my /etc
--- edit ---
After trying some things, and always ending up with a resetted /etc/master.passwd and similar important files, making you unable to sudo or let alone login.
I decided to go with a path that still in the long run will save time/bandwith (not that i care about bandwith for me but for the fbsd servers)
Initially, run the pkbasify.lua script, then after that upgrade using the pkgbasify server. (hopefully ill find a way to avoid that aswell)
--- edit ---
On the build server:
$ doas pkg install -y devel/ccache4 devel/git net/gitup sysutils/beadm sysutils/htop www/nginx
$ doas cp /usr/local/etc/gitup.conf.sample /usr/local/etc/gitup.conf
(edit to specify the release you want, lets say 14.2)
PS. If you are upgrading /usr/src from 14.2 to say 14.3 you need to remove the contents of /usr/src before: doas gitup release , it does not want to upgrade otherwise it seems?!
$ doas cat /etc/make.conf
CCACHE_DIR=/var/cache/ccache
WITH_CCACHE_BUILD=yes
$ doas gitup release
$ doas mkdir -p /var/tmp/pkgbase/repo && cd /usr/src
$ doas make REPRODUCIBLE_BUILD=1 REPODIR=/var/tmp/pkgbase/repo -j 10 buildworld buildkernel
$ doas make REPRODUCIBLE_BUILD=1 REPODIR=/var/tmp/pkgbase/repo -j 10 packages # needs to be run separately
--- edit ---
After these steps, if you want to pkgbasify your server. Run the pkgbasify.lua script (or install/run it from within once it is part of pkg)
$ fetch https://github.com/FreeBSDFoundation/pkgbasify/raw/refs/heads/main/pkgbasify.lua
$ chmod +x ./pkgbasify.lua
$ doas ./pkgbasify.lua
$ doas reboot
The next upgrade, or patch, when you should have used: freebsd-update fetch install you Update FreeBSD-base.conf to below
You might run into a warning, but it makes sense since you are upgrading from v14.2 to v14.3:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1403000
- running userland: 1402000
--- edit ---
renamed the repo conf to FreeBSD-pkbase.conf
$ doas cat /usr/local/etc/pkg/repos/FreeBSD-pkbase.conf
FreeBSD-pkbase: {
url: "file:///var/tmp/pkgbase/repo/\${ABI}/latest",
mirror_type: "srv",
#signature_type: "fingerprints",
#fingerprints: "/usr/share/keys/pkg",
enabled: yes
}
Next update, after built packages:
$ doas pkg update -f -r FreeBSD-pkbase && doas pkg update -f -r FreeBSD-pkbase
We need to enable nginx as webserver than host the path to where we built the packages from it.
$ doas sysrc nginx_enable="YES"
On clients:
Initially, run the pkgbasify script.
$ fetch https://github.com/FreeBSDFoundation/pkgbasify/raw/refs/heads/main/pkgbasify.lua
$ chmod +x ./pkgbasify.lua
$ doas ./pkgbasify.lua
After that, when you do your next upgrade/patch (that you would have used freebsd-update fetch install for). Update FreeBSD-pkbase.conf to below, then:
$ doas pkg update -f -r FreeBSD-pkbase && doas pkg upgrade -f -r FreeBSD-pkbase
$ doas reboot
$ doas cat /usr/local/etc/pkg/repos/FreeBSD-pkbase.conf
FreeBSD-pkbase: {
url: "pkg+https://192.168.0.31/${ABI}/latest",
mirror_type: "srv",
enabled: yes
}