Jail maintenance
From wikinotes
Updating Jail Packages
# Updating Packages # If all you're looking to do is to maintain your packages, # you can update all of your jails from your root system pkg -j wikinotes upgrade for jid in `jls | awk '{print $1}'`; do sudo pkg -y -j $jid upgrade; done
Updating Jails
Patch Updates
freebsd-update -b /usr/local/jails/myjail/filesystem fetch freebsd-update -b /usr/local/jails/myjail/filesystem installMinor/Major Updates
NOTE:
jails run the host's kernel, so
uname -a
won't show the release installed to the jail.
You might be able to usefreebsd-version
, but I haven't tested it.first update the host
freebsd-update upgrade \ --currently-running 12.0-RELEASE \ -r 13.0-RELEASE # 1st run freebsd-update install sudo reboot # 2nd run freebsd-update install sudo pkg upgradenext update each jail
freebsd-update \ -b /usr/local/jails/${JAIL}/filesystem \ --currently-running 12.0-RELEASE \ -r 12.1-RELEASE \ upgrade freebsd-update \ -b /usr/local/jails/${JAIL}/filesystem install service jail restart ${JAIL} freebsd-update \ -b /usr/local/jails/${JAIL} \ install pkg -j ${JAIl} upgrade