Skip to content

Instantly share code, notes, and snippets.

@grahamperrin
Last active November 1, 2025 11:38
Show Gist options
  • Select an option

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

Select an option

Save grahamperrin/a58edbb8587af513a154ac01d922f611 to your computer and use it in GitHub Desktop.
FreeBSD: pkgbase: major upgrades

FreeBSD: pkgbase: major upgrades

A rough guide, for alpha testing on AMD64:

  • tested with FreeBSD 15.0-ALPHA2 and ALPHA3
  • things might be less rough with ALPHA4, with or without the next release of ports-mgmt/pkg.

Not intended to be comprehensive.

Preamble

It's conventional to upgrade the userland part of base before upgrading non-base packages.

The numbered steps below break from convention. The disorderly approach is a workaround to pkg issue #2414. Proceed with caution.

Also, please note:

14.3-RELEASE-p3 to 15.0-ALPHA3

  1. su -
  2. pkg install devel/uclcmd
  3. /bin/tcsh
  4. pkg prime-origins | sort -u > /var/tmp/pkg-prime-origins.txt
  5. /usr/local/etc/periodic/daily/411.pkg-backup
  6. pkg upgrade
  7. uclcmd set --file /usr/local/etc/pkg/repos/FreeBSD-base.conf FreeBSD-base.url 'pkg+https://pkg.freebsd.org/${ABI}/base_latest'
  8. pkg -v
  9. note the version
  10. pkg lock -y pkg
  11. touch /usr/local/etc/pkg/repos/FreeBSD.conf
  12. cat /usr/local/etc/pkg/repos/FreeBSD.conf
  13. if the file is empty, run an echo command
  14. echo "FreeBSD {url = example} FreeBSD-kmods {url = example}" > /usr/local/etc/pkg/repos/FreeBSD.conf
  15. uclcmd set --file /usr/local/etc/pkg/repos/FreeBSD.conf FreeBSD.url 'pkg+https://pkg.freebsd.org/${ABI}/latest'
  16. uclcmd set --file /usr/local/etc/pkg/repos/FreeBSD.conf FreeBSD-kmods.url 'pkg+https://pkg.freebsd.org/${ABI}/kmods_latest'
  17. env ABI=FreeBSD:15:amd64 pkg update -f
  18. ignore all on-screen suggestions to run pkg bootstrap -f
  19. sysctl vm.pageout_oom_seq=120
  20. env ABI=FreeBSD:15:amd64 pkg upgrade --fetch-only --yes
  21. conflicts may be observed as a result of the fetch, another iteration (run of the command) may be required
  22. bectl create fourteen-fifteen-ready
  23. env ABI=FreeBSD:15:amd64 pkg upgrade -U FreeBSD-kernel-generic
  24. history -S
  25. exit
  26. shutdown -r now
  27. login as root at ttyv1
  28. /bin/tcsh
  29. service cron stop
  30. /usr/local/etc/periodic/daily/411.pkg-backup
  31. sysctl vm.pageout_oom_seq=120
  32. env ABI=FreeBSD:15:amd64 pkg-static upgrade -fU --repository FreeBSD
  33. env ABI=FreeBSD:15:amd64 pkg-static upgrade
  34. if the upgrades were successful, history -S then exit and shutdown -r now
  35. ee /usr/local/etc/pkg/repos/FreeBSD.conf
  36. modernise the repository names – FreeBSD-ports and FreeBSD-ports-kmods
  37. pkg install -nU -r FreeBSD-base --glob 'FreeBSD-set-*'
  38. decide whether you want any base meta package (for a FreeBSD Project-defined set of packages)
  39. pkg install -nU -r FreeBSD-base --glob 'FreeBSD-*'
  40. decide whether you want any additional base package
  41. when you're certain that bootstrap will not result in a downgrade, pkg-static unlock -y pkg && pkg bootstrap -fy