Jail maintenance: Difference between revisions

From wikinotes
 
(3 intermediate revisions by the same user not shown)
Line 8: Line 8:
pkg -j wikinotes upgrade
pkg -j wikinotes upgrade


for jid in `jls | awk '{print $1}'`; do sudo pkg -y -j $jid upgrade; done
for jid in `jls | awk '{print $1}'`; do yes | sudo pkg -j $jid upgrade; done
</source>
</source>


Line 15: Line 15:
= Updating Jails =
= Updating Jails =
<blockquote>
<blockquote>
See also [[Freebsd release management]]
== Patch Updates ==
== Patch Updates ==
<blockquote>
<blockquote>
Line 26: Line 28:
<blockquote>
<blockquote>
{{ NOTE |
{{ NOTE |
jails run the host's kernel, so <code>uname -a</code> won't show the release installed to the jail.<br>
See <code>jail-update</code> executable, less typing.
You might be able to use <code>freebsd-version</code>, but I haven't tested it. }}
}}


first update the host
first update the host
Line 43: Line 45:
sudo pkg upgrade
sudo pkg upgrade
</source>
</source>
next determine the jail's version
<syntaxhighlight lang="bash">
# NOTE:
#  cat /etc/os-release  # innacurate if freebsd-upgrade used
#  uname -a              # innacurate, jails use host kernel
freebsd-version  # prints version (confirmed works for jail)
</syntaxhighlight>


next update each jail
next update each jail

Latest revision as of 23:47, 2 June 2023

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 yes | sudo pkg -j $jid upgrade; done

Updating Jails

See also Freebsd release management

Patch Updates

freebsd-update -b /usr/local/jails/myjail/filesystem fetch
freebsd-update -b /usr/local/jails/myjail/filesystem install

Minor/Major Updates

NOTE:

See jail-update executable, less typing.

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 upgrade

next determine the jail's version

# NOTE:
#   cat /etc/os-release   # innacurate if freebsd-upgrade used
#   uname -a              # innacurate, jails use host kernel
freebsd-version  # prints version (confirmed works for jail)

next 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