Skip to main content
  1. Posts/

Quickly Update Freebsd 15.x and Over and All Jails

Assuming you have:

  • pkgbase and 15.x FreeBSD server with a bunch of jails
  • bastille as the jail manager
  • and that the host and all jails are on pkgbase

here’s a single command to upgrade them all in one shot. What does the command do:

  1. Upgrades the host.
  2. Finds and upgrades all jails.
  3. Restarts all jails thereafter.
pkg update -f && pkg upgrade -y && ( set -e; for jail in $(bastille list jail); do echo "=== Updating $jail ==="; bastille update "$jail"; done ) && bastille pkg ALL update -f && bastille pkg ALL upgrade -y && bastille restart ALL

♨️

Sanjay Regmi
Author
Sanjay Regmi