Skip to content

Instantly share code, notes, and snippets.

@grahamperrin
Last active January 1, 2026 09:46
Show Gist options
  • Select an option

  • Save grahamperrin/d4d1948e7a54d79f8b2664ff76b8bbeb to your computer and use it in GitHub Desktop.

Select an option

Save grahamperrin/d4d1948e7a54d79f8b2664ff76b8bbeb to your computer and use it in GitHub Desktop.
Adding the FreeBSD-src-16 base package to inferior versions of FreeBSD, for the FreeBSD-base 15 repo keys

Adding the FreeBSD-src-16 base package to inferior versions of FreeBSD, for the FreeBSD-base 15 repo keys

For https://www.freebsd.org/releases/15.0R/relnotes/#upgrade-rc and the like.

Where a pair of cp commands involves these two paths – a file, and a directory file:

/usr/src/usr.sbin/pkg/FreeBSD.conf.quarterly-release
/usr/src/share/keys/pkgbase-15

A lazy alternative to Git

If /usr/src/ is not populated:

  1. /bin/sh
  2. ABI=FreeBSD:16:amd64 ; export ABI
  3. IGNORE_OSVERSION=yes ; export IGNORE_OSVERSION
  4. fetch -o /tmp/FreeBSD-src-16.pkg https://pkg.freebsd.org/FreeBSD:16:$(uname -p)/base_weekly/FreeBSD-src-16.snap20251228082320.pkg
  5. pkg add /tmp/FreeBSD-src-16.pkg
  6. ignore the bootstrap recommendation
  7. run the the two cp commands
  8. exit
  9. pkg delete --quiet --yes FreeBSD-src-16.snap20251228082320
  10. rm /usr/share/keys/pkgbase-15/Makefile
  11. rm /usr/share/keys/pkgbase-15/trusted/Makefile

The date part of the .snap20251228082320 part of the URL will change.

Side notes

I had things such as this on hold during my popcorn-eating month in the run-up to 15.0-RELEASE.

Tested with an intentionally outdated installation of 14.3 on on Thursday 2026-01-01 🎉

Prior to testing:

blah@fourteen-three-minimal:~ % pkg which /usr/bin/uname
/usr/bin/uname was not found in the database
blah@fourteen-three-minimal:~ % freebsd-version -kru ; uname -mvKU
14.3-RELEASE
14.3-RELEASE
14.3-RELEASE
FreeBSD 14.3-RELEASE releng/14.3-n271432-8c9ce319fef7 GENERIC amd64 1403000 1403000
blah@fourteen-three-minimal:~ % pkg repos -el | sort -f ; sleep 5 ; pkg repos -e | grep -B 1 url
FreeBSD
FreeBSD-kmods
FreeBSD: { 
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly",
--
FreeBSD-kmods: { 
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_quarterly_3",
blah@fourteen-three-minimal:~ % pkg -v
2.4.2
blah@fourteen-three-minimal:~ % pkg iinfo ^pkg$
pkg-2.4.2
blah@fourteen-three-minimal:~ % du -hs /usr/src
512B    /usr/src
blah@fourteen-three-minimal:~ % ls -hln /usr/src
total 0
blah@fourteen-three-minimal:~ % 

I can not easily test 15.0 PRERELEASE, ALPHA, or BETA. Sorry.

I deleted all FreeBSD Project-provided snapshots, for that version range, after 15.0-RELEASE was announced.

The recent historic snapshots are no longer at https://download.freebsd.org/.

@grahamperrin
Copy link
Author

In practice, I would use net/gitup, as shown in my rough notes at https://www.reddit.com/r/freebsd/comments/1pdsyfo/comment/nty3dqx/. For this use case, it's much simpler. Two steps:

  1. install
  2. run.

I documented the longer approach with FreeBSD-src-16 mainly because I'm curious about alternative workarounds to the pkgbase.freebsd.org keys situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment