FreeBSD 14
Sponsored Link

初期設定 : システムを最新化する2023/12/14

 
サーバー運用開始後はシステムのアップデートが難しい場面もありますが、少なくともインストール直後のシステム構築時はシステムを最新化しておきましょう。
[1] インストールされてるパッケージを最新のバージョンに更新するには以下のように実行します。
# リポジトリのカタログ更新

root@dlp:~ #
pkg update

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.

# パッケージ更新

root@dlp:~ #
pkg upgrade -y

The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.20.8...
Extracting pkg-1.20.8: 100%
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
Fetching packagesite.pkg: 100%    7 MiB 551.3kB/s    00:13
Processing entries: 100%
FreeBSD repository update completed. 33875 packages processed.
All repositories are up to date.
Updating database digests format: 100%
Checking for upgrades (1 candidates): 100%
Processing candidates (1 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
[2] カーネルを含むベースシステムを最新の状態に更新するには以下のように実行します。
# 現在のバージョン

root@dlp:~ #
freebsd-version

14.0-RELEASE
# 最新のパッチをダウンロード

root@dlp:~ #
freebsd-update fetch

src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching public key from update2.freebsd.org... done.
Fetching metadata signature for 14.0-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata files... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 255 patches.....10....20....30....40....50....60....70....80....90....100....110....120....130....140....150....160....170....180....190....200....210....220....230....240....250.. done.
Applying patches... done.
The following files will be updated as part of updating to
14.0-RELEASE-p8:
/bin/df
/bin/freebsd-version
/bin/mv

.....
.....

# 最後に更新ファイルが pager 系のコマンドに渡されて表示される
# 確認する場合はスペースキーやカーソルキーでスクロールする
# 終了する場合は [q] キー

# ダウンロードしたパッチを適用

root@dlp:~ #
freebsd-update install

src component not installed, skipped
Creating snapshot of existing boot environment... done.
Installing updates...
Restarting sshd after upgrade
Performing sanity check on sshd configuration.
Stopping sshd.
Waiting for PIDS: 860, 860.
Performing sanity check on sshd configuration.
Starting sshd.
Scanning /usr/share/certs/untrusted for certificates...
Scanning /usr/share/certs/trusted for certificates...
 done.

# カーネルが更新された場合は要再起動

root@dlp:~ #
reboot
root@dlp:~ #
freebsd-version

14.0-RELEASE-p8
[3] システムのマイナーバージョンを最新に更新するには以下のように実行します。
# 現在のバージョン

root@dlp:~ #
freebsd-version

14.0-RELEASE-p8
# FreeBSD 14.1 に更新

root@dlp:~ #
freebsd-update upgrade -r 14.1-RELEASE

src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 14.0-RELEASE from update1.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 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)? y

etching metadata signature for 14.1-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.

.....
.....

The following files will be removed as part of updating to
14.1-RELEASE-p2:
/etc/ssl/certs/f3377b1b.0
/usr/include/c++/v1/__bsd_locale_defaults.h
/usr/include/c++/v1/__bsd_locale_fallbacks.h
/usr/include/c++/v1/__debug
/usr/include/c++/v1/__errc
/usr/include/c++/v1/__functional/unwrap_ref.h
/usr/include/c++/v1/__mutex_base

.....
.....

# 最後に更新ファイルが pager 系のコマンドに渡されて表示される
# 確認する場合はスペースキーやカーソルキーでスクロールする
# 終了する場合は [q] キー

# ダウンロードしたファイルを適用

root@dlp:~ #
freebsd-update install

src component not installed, skipped
Creating snapshot of existing boot environment... done.
Installing updates...
Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.

# バージョンアップ時は再起動して
# メッセージにある通り 再度 [freebsd-update]

root@dlp:~ #
reboot
root@dlp:~ #
freebsd-update install

src component not installed, skipped
Creating snapshot of existing boot environment... done.
Installing updates...
Restarting sshd after upgrade
Performing sanity check on sshd configuration.
Stopping sshd.
Waiting for PIDS: 876.
Performing sanity check on sshd configuration.
Starting sshd.
Scanning /usr/share/certs/untrusted for certificates...
Scanning /usr/share/certs/trusted for certificates...
 done.

root@dlp:~ #
freebsd-version

14.1-RELEASE-p2
関連コンテンツ