1. 概要
例によって「VirtualBox」上に、「FreeBSD 14.1 RELEASE」のマシンがあります。
これを「FreeBSD 14.2 RELEASE」にアップデートするところからやってみます。
アップデート前のマシンは、いくつかのサーバアプリケーションをインストールしたものです。
2. ports の更新
放置しておいたので、アップデートの発生している、「ports」が山ほどあります。
全部更新しておきます。
「13.3 RELEASE」を「13.4 RELEASE」へ更新するときには、更新できないものがありましたが、今回は、すべて更新できました。
3. パッチをあてる
仮想マシンの現在の状況を見てみます。
$ uname -a
FreeBSD ns.vm.sing.ne.jp 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
パッチがあたっていないので、パッチをあてるところから・・・。
以下、「root」ユーザ権限で。
freebsd-update fetch
メッセージは長々と出力されるので割愛します。
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching public key from update1.freebsd.org... done.
Fetching metadata signature for 14.1-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata files... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 115 patches.....10....20....30....40....50....60....70....80....90....100....110.. done.
Applying patches... done.
The following files will be updated as part of updating to
14.1-RELEASE-p6:
/bin/freebsd-version
/boot/kernel/cfiscsi.ko
・・・ 略 ・・・
/rescue/csh
/rescue/date
/rescue/dd
:
Space と q で進めていきます。
プロンプトが返ってきたら。アップデート。
freebsd-update install
メッセージは、これだけ。
Creating snapshot of existing boot environment... done.
Installing updates...
Restarting sshd after upgrade
Performing sanity check on sshd configuration.
Stopping sshd.
Waiting for PIDS: 914.
Performing sanity check on sshd configuration.
Starting sshd.
Scanning /usr/share/certs/untrusted for certificates...
Scanning /usr/share/certs/trusted for certificates...
Scanning /usr/local/share/certs for certificates...
done.
再起動。
shutdown -r now
更新を確認。
$ uname -a
FreeBSD ns.vm.sing.ne.jp 14.1-RELEASE-p5 FreeBSD 14.1-RELEASE-p5 GENERIC amd64
「FreeBSD 14.1-RELEASE」から「FreeBSD 14.1-RELEASE-p5」へ変わっています。
4. GENERIC boot を用意しておく
今回、マイナバージョンのアップグレードなので、「kernel」ファイルは必要ないかと思います。
もし必要になったら、以下の手順で用意します。
「.iso」ファイルをダウンロードして、それをマウントするのが手っ取り早い。
カーネルさえあればいいので、「DVD」メディアでなく、「CD」メディアで十分。
ダウンロード。
mkdir -pv /tmp/disk
cd /tmp/disk
curl https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/14.1/FreeBSD-14.1-RELEASE-amd64-disc1.iso --output FreeBSD-14.1-RELEASE-amd64-disc1.iso
5. バージョンアップ
バージョンアップ。
「root」ユーザ権限で。
freebsd-update -r 14.2-RELEASE upgrade
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 14.1-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata files... done.
Inspecting system... done.
The following components of FreeBSD seem to be installed:
kernel/generic kernel/generic-dbg src/src world/base world/lib32
The following components of FreeBSD do not seem to be installed:
world/base-dbg world/lib32-dbg
Does this look reasonable (y/n)?
yEnter で答えます。
以降、メッセージはなるべく省略して、入力が必要な個所のみ記述します。
The following changes, which occurred between FreeBSD 14.1-RELEASE and
FreeBSD 14.2-RELEASE have been merged into /etc/ssh/sshd_config:
--- current version
+++ new version
@@ -103,11 +103,11 @@
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#UseBlacklist no
-#VersionAddendum FreeBSD-20240318
+#VersionAddendum FreeBSD-20240806
# no default banner path
#Banner none
# override default of no subsystems
Does this look reasonable (y/n)?
yEnter で答えます。
The following files will be removed as part of updating to
14.2-RELEASE-p0:
/usr/lib/ossl-modules/fips.so
/usr/lib32/ossl-modules/fips.so
/usr/share/examples/sound/README
・・・ 略 ・・・
/usr/src/contrib/unbound/testdata/09-unbound-control.tdir/conf.spoofed_credentials
/usr/src/contrib/unbound/testdata/cachedb_cached_ede.crpl
/usr/src/contrib/unbound/testdata/cachedb_expired.crpl
:
Space と q で進めていきます。
マイナーチェンジなので、やることは、少ないはずです。
最後は、下記を出力して、プロンプトが返ってきます。
To install the downloaded upgrades, run 'freebsd-update [options] install'.
では、アップグレード。
/usr/sbin/freebsd-update install
Creating snapshot of existing boot environment... done.
Installing updates...
Kernel updates have been installed. Please reboot and run
'freebsd-update [options] install' again to finish installing updates.
ちゅうことで、再起動。
shutdown -r now
6. 再起動後
再起動後にログインしたときのログイン時のメッセージが
FreeBSD 14.2-RELEASE (GENERIC) releng/14.2-n269506-c8918d6c7412
となっております。
「root」ユーザ権限で。
/usr/sbin/freebsd-update install
この下のメッセージの途中は、時間がかかります。
Creating snapshot of existing boot environment... done.
Installing updates...
Restarting sshd after upgrade
Performing sanity check on sshd configuration.
Stopping sshd.
Waiting for PIDS: 880, 880.
Performing sanity check on sshd configuration.
Starting sshd.
Scanning /usr/share/certs/untrusted for certificates...
Scanning /usr/share/certs/trusted for certificates...
Scanning /usr/local/share/certs for certificates...
done.
「ports」の更新を確認します。
git -C /usr/ports pull
portsdb -Fu
portversion -v | grep '<'
4つほど更新があります。
bind-tools-9.20.2 < needs updating (index has 9.20.4)
python311-3.11.10 < needs updating (index has 3.11.11)
tcl86-8.6.15_2 < needs updating (index has 8.6.16_2)
tree-2.1.3 < needs updating (index has 2.2.1)
すべて、「portupgrade」で更新しました。
本番前の練習としては、十分かと思います。