I'm running FreeBSD-current on a small VM with 1GB RAM. I can build the world, but not the kernel anymore due out of memory (and slow swap). I tried to upgrade the installed packages on the machine, and got a error message that the running kernel is outdated: # pkg update Updating FreeBSD repository catalogue... Fetching meta.txz: 100% 944 B 0.9kB/s 00:01 Fetching packagesite.txz: 100% 6 MiB 901.3kB/s 00:07 Processing entries: 0% pkg: Newer FreeBSD version for package tdb: - package: 1200062 - running kernel: 1200055 pkg: repository FreeBSD contains packages for wrong OS version: FreeBSD:12:amd64 Processing entries: 100% Unable to update repository FreeBSD Error updating repositories! # echo $? 70 If I run the command again, I get no error at all: # pkg update Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. # echo $? 0 I expect that in case my kernel is outdated I always get an error from the pkg tool until I update my kernel.
Upgrade to a newer version of pkg and it will prompt to you if you want to continue or not. You can just: pkg delete -f pkg and rebootstrap it.