Re: Tracking a custom build of -STABLE on pkgbase?

From: Matthew Seaman <matthew_at_FreeBSD.org>
Date: Sun, 08 Nov 2026 11:28:13 UTC
On 08/11/2026 02:05, Eason Qin wrote:
> Greetings, people
> 
> These past few days marked the end of my FreeBSD hiatus; the last time I 
> really daily drove this OS was when FreeBSD 14 was -CURRENT, and I have 
> noticed that pkgbase is now a thing. Very cool! even less fragmentation 
> as the base system itself is also packaged.
> 
> However, my tradition is to always build -STABLE with -march=native for 
> my CPU and for the fun and games, but it seems like building that on a 
> pkgbase system has a loooot of complications (it's effectively going 
> from pkgbase back to distribution sets). How do I take the new world 
> (and custom kernel!) that I just compiled and install it?
> 
> It seems as if I could:
> 1. Do some magic to package the world I just built
> 2. Somehow convert my pkgbase system into a distribution sets sytem
> 
> Could someone please tell me how?
You do not need to use distribution sets to have a self-compiled FreeBSD 
stable system. Just build your own base packages.  It's as easy as:

```
% cd /usr/src
% make buildworld buildkernel
% make packages
```

This will create a package repo under /usr/obj and you can configure pkg 
to use that (rather than the default FreeBSD-base repo) using a file:// URL.

Now, if this is just an update to an already pkgbase-ified system, 
installing the updated packages is essentially just `pkg upgrade` as 
you'ld expect -- although it's a good idea to wrap that in creating a 
new boot environment, or install just the new kernel package, reboot to 
single-user, and then update the rest of the world packages (analogously 
to the recommended methods for installing directly from /usr/src).

If you have a newly installed system using one of the release package 
sets, then you can just `pkg install` from your -STABLE package repo to 
switch to the -STABLE branch.  You may need to set some commandline 
arguments to tell pkg to go ahead and install packages for a different 
OS version, but it prompts you on how to do that.

If your system is not already converted to using pkgbase, then start here:

	https://github.com/FreeBSDFoundation/pkgbasify

If you put your own pkg config in-place pointing at the base system 
packages you compiled, rather than using the default FreeBSD packages, I 
believe (but I haven't verified) it should just work...

I've been running all my own systems and jails using my own 
home-compiled STABLE-14 and now STABLE-15 base system packages for 
years.  Once my package repos are updated, it makes actually upgrading 
each system take only a few minutes.  I do have things set up in a more 
complicated way, using poudriere to maintain my own repos for both ports 
and base system packages served by an nginx webserver.

	Cheers,

	Matthew