How to set OSVERSION while creating jail with pkgbase by poudriere?


root@anna:~ # poudriere jail -c -j 15 -m pkgbase -v 15
[00:00:00] Creating 15 fs at /usr/local/poudriere/jails/15... done
[00:00:00] Installing 15 amd64 from pkg+https://pkg.freebsd.org/ ...pkg: Setting ABI requires setting OSVERSION, guessing the OSVERSION as: 1500000

I want to set OSVERSION=1501000 to create a 15.1 jail
 
I want to set OSVERSION=1501000 to create a 15.1 jail
No, you set -v 15.1-RELEASE to actually get a 15.1-RELEASE jail.

Code:
     -v version       Specify the version of FreeBSD to use in the jail.  For
                      most methods, and by default if no -m is specified,
                      version should in the form of “12.0-RELEASE”.  If you
                      are using -m git, or -m svn, then the version should be
                      in the form of Git or SVN branches, which is usually in
                      the form of “stable/9” or “main” for CURRENT from git.
                      Other methods only use the version value for display.
poudriere-jail(8)
 
No, you set -v 15.1-RELEASE to actually get a 15.1-RELEASE jail.

Code:
     -v version       Specify the version of FreeBSD to use in the jail.  For
                      most methods, and by default if no -m is specified,
                      version should in the form of “12.0-RELEASE”.  If you
                      are using -m git, or -m svn, then the version should be
                      in the form of Git or SVN branches, which is usually in
                      the form of “stable/9” or “main” for CURRENT from git.
                      Other methods only use the version value for display.
poudriere-jail(8)
-v $V will replace the ABI FreeBSD:$V:amd64, so 15 is the value for -m pkgbase.

root@anna:~ # poudriere jail -c -j 151 -m pkgbase -v 15.1-RELEASE
[00:00:00] Creating 151 fs at /usr/local/poudriere/jails/151... done
[00:00:00] Installing 15.1-RELEASE amd64 from pkg+https://pkg.freebsd.org/ ...pkg: Invalid version in ABI string 'FreeBSD:15.1-RELEASE:amd64'
pkg: Cannot parse configuration file!
[00:00:00] Error: pkg update failed
[00:00:00] Error while creating jail, cleaning up.
[00:00:00] Removing 151 jail... done
 
After some try and error, and consulting a chatbot (which proposed a partially incorrect solution), try
Code:
poudriere jail -c -j 151amd64 -v 15 -a amd64 -m pkgbase=base_release_1 -U https://pkg.freebsd.org/
Ignore the OSVERSION, see poudriere jail -l for the installed version.

The poudriere-jail(8) -m pkgbase method pulls in a complete"FreeBSD-set-base" (200+ packages).

Alternatively, install one of the pkgbase jail packages with pkg(8) and poudriere-jail(8) import the jail.

Here an example of a local pkgbase repository:
Code:
ls /usr/obj/usr/src-15.1/repo/FreeBSD:15:amd64/latest | grep jail
FreeBSD-jail-15.1p2.pkg
FreeBSD-set-base-jail-15.1p2.pkg
FreeBSD-set-base-jail-dbg-15.1p2.pkg
FreeBSD-set-minimal-jail-15.1p2.pkg
FreeBSD-set-optional-jail-15.1p2.pkg

Example creating a "FreeBSD-jail" package jail:
Code:
# zfs create zroot/poudriere/jails/151amd64

# pkg -r /usr/local/poudriere/jails/151amd64 install -r FreeBSD-base FreeBSD-jail

# poudriere jail -c -j 151amd64 -v 15.1-RELEASE -a amd64 -m null -M /usr/local/poudriere/jails/151amd64/

# poudriere jail -l
JAILNAME VERSION      OSVERSION ARCH  METHOD TIMESTAMP           PATH
151amd64 15.1-RELEASE           amd64 null   2026-11-18 13:53:18 /usr/local/poudriere/jails/151amd64
EDIT: On second thought, the FreeBSD-jail package method might not be suitable for poudriere, since some packages require system sources for building kernel modules, or require other base system libraries, which are not part of the FreeBSD-*jail packages.
 
-m pkgbase: forces pkg+https://pkg.freebsd.org/ with base repo base_release_${VERSION_MINOR} (code)

-m pkgbase=<base_repo>: allows one to customize the URL (e.g. -U pkg+https://pkg.freebsd.org/) and the base release through pkgbase= (code). Use -v <version> flag to set OS major version (e.g. 15).

I use local caching PKG server and create poudriere jails in the following way:

Code:
poudreire jail -c -j example -m 'pkgbase=base_release_${VERSION_MINOR}' -U pkg+https://pkg.example.com/ -v 15
 
Back
Top