On 20/11/2025 12:49, void wrote:
What I'm ultimately looking for, is a method of transforming
a pkgbase system into a not-pkgbase one, that upgrades
in the traditional source-based way.

This is how I would do it:

0) Make sure all packages are up-to-date and any no-longer required
   automatic packages have been removed.

   # pkg upgrade
   # pkg autoremove -y

1) Make a list of all the packages you have installed that aren't
   FreeBSD base packages.  You can exclude anything automatically
   installed as a dependency of anything else:

   % pkg query -e '%a = 0' '%n' | grep -v ^FreeBSD > packages.list

2) Move aside the pkg database in /var/db/pkg

   # mv /var/db/pkg /var/db/pkg.old

3) Re-install pkg(8) using pkg(7)

   # pkg bootstrap -f

4) Re-install all of the non-base packages from step (1)

   # xargs pkg install < packages.list

Untried, so may need refinement, but that's the gist of it. You do end up having to overwrite all previously installed non-base software with an identical copy of itself. The only other alternative would be directly modifying the pkg sqlite database, but that's not something I can easily describe how to do.

However, this does seems like a retrograde step to me. It is possible to build your own packages from the source tree, and then update your system from those, which gives you pretty much the benefits of both worlds:

   # cd /usr/src
   # git pull
   # make buildworld buildkernel packages
   # cat <<EOF > /usr/local/etc/pkg/repos/FreeBSD-base.conf
   FreeBSD-base: {
     url: file:///usr/obj/usr/src/repo
     enabled: yes
     priotiry: 1
   }
   EOF
   # pkg upgrade

Again, untested and you'll probably have to flesh this sequence of commands out a bit and work on the details, but that should give an idea of how it would work.

        Cheers,

        Matthew




Reply via email to