Re: Some questions about pkgbase

From: Matthew Seaman <matthew_at_FreeBSD.org>
Date: Thu, 27 Nov 2025 12:09:29 UTC
On 26/11/2025 18:57, Andrea Venturoli wrote:
> On 11/26/25 19:42, Matthew Seaman wrote:

>>> Can this be done with poudriere?
>>
>> Yes.
> Perfect!
> Is there a good how-to in order to start testing?

I don't recall finding one.  I just worked from the man pages.  I've one 
poudriere jail used solely for building base packages:

```
% poudriere jail -j stable14base -i
Jail name:         stable14base
Jail version:      14.3-STABLE 1403506
Jail vcs version:  c108844843
Jail arch:         amd64
Jail method:       git+https
Jail mount:        /usr/local/poudriere/jails/stable14base
Jail fs:           zroot/jail/pkg/poudriere/jails/stable14base
Jail kernel:       GENERIC
Jail updated:      2025-10-23 13:01:10
Jail pkgbase:      enabled
Exiting with status 0
```

To update packages in this jail I just run:
```
poudriere jail -u -j stable14base
```

The packages built by this jail are served to the rest of my systems and 
to the jail where I build ports using nginx:

```
         location /FreeBSD:14:amd64/base {
             alias 
/usr/local/poudriere/data/images/stable14base-repo/FreeBSD:14:amd64/latest;
         }
```

(Plus all the usual boilerplate and letsencrypt certs required in 
nginx.conf)

I could merge the base and package building jails but I like being able 
to build base systems pkgs and ports pkgs more independently.

>> I run some 14-STABLE machines using base system and ports packages 
>> that are all self-built in my own poudriere instance.  Works 
>> absolutely fine.   There are quite a few enhancements to FreeBSD-base 
>> packaging that are going into 15, which generally make it easier to 
>> use and cover additional use cases, like building thin jails and so 
>> forth.
> Now that we are at it...
> 
> I use thin jails with ezjail, so, after upgrading base, I normally use 
> "ezjail-admin update -i" to upgrade the "basejail" that is shared among 
> all others.
> Is this possible with pkgbase?
> On 14.3?

I know nothing about how ezjail works I'm afraid.  It might work with 
base pkgs, if the ezjail authors have added support for it.

> Also, can we use pkgbase in order to upgrade Poudriere's own jails?

Yes.  You can configure a jail to use pkgs from another jail:

```
# poudriere jail -j stable14amd64 -i
Jail name:         stable14amd64
Jail version:      14.1-STABLE
Jail arch:         amd64
Jail method:       pkgbase
Jail mount:        /usr/local/poudriere/jails/stable14amd64
Jail fs:           zroot/jail/pkg/poudriere/jails/stable14amd64
Jail updated:      2025-10-25 10:53:58
Jail pkgbase:      disabled
```

See poudriere-jail(8) and the description of the '-m' option where you 
can specify the `pkgbase` method and the repository URL.

	Cheers,

	Matthew