Re: changing from pkgbase to regularbase

From: void <void_at_f-m.fm>
Date: Thu, 20 Nov 2025 19:28:34 UTC
On Thu, Nov 20, 2025 at 02:56:46PM +0000, Matthew Seaman wrote:
>
>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.

Thank you. That mostly did it. After a reboot, I had to do the following
afterwards because another buildinstallkernelworld cycle still asked 
for DESTDIR:

-1: reboot
0. disable /usr/local/etc/pkg/repos/FreeBSD-base.conf
1. move /etc/src-env.conf aside (disabling META_MODE)
2. kldunload filemon and make sure it stayed unloaded
3. rm -rf /usr/obj
4. rm -rf /usr/src
5. get the src again via git
6. pkg clean -y
7. cd /usr/src && make cleanworld cleandir clean && make -j16 kernel

(no prompt at the end for DESTDIR)
>
>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:

I wanted the system to be as if I'd selected the traditional 
install and not the new type and this does it. So now it 
can use the pkg cluster just for ports packages not for pkgbase
and source builds/upgrades in /usr/src don't prompt for a DESTDIR
--