FreeBSD 7.0-RELEASE Announcement,freebsd-update(8) provides officially supported binary upgrades to new releases in addition to security fixes and errata patches.
环境准备
如果是 csh(14 以下 root 默认为 csh):
# setenv EDITOR /usr/bin/ee # 切换 vi 为 ee,vi 不会用
# setenv VISUAL /usr/bin/ee # 切换 vi 为 ee,vi 不会用
如果是 bash、zsh 或 sh(14 及以上 root 默认为 sh):
# export EDITOR=/usr/bin/ee # 切换 vi 为 ee,vi 不会用
# export VISUAL=/usr/bin/ee # 切换 vi 为 ee,vi 不会用
root@ykla:/home/ykla # freebsd-update upgrade -r 14.2-RELEASE
src component not installed, skipped
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 patches. done.
Applying metadata patches... 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,然后回车即可,在检查基本组件的安装情况。
Fetching metadata signature for 14.2-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done. # 这里在检查系统,从上面的回车到这里需要等待约 10 分钟。
Fetching files from 14.1-RELEASE for merging... done.
Preparing to download files... # 这里在准备要下载的文件,需要等待约 15 分钟。
# 下面需要等待约 30 分钟。注意,当跨大版本更新时,有时候需要等待 5 小时会更长时间,这都是正常的。
Fetching 4070 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....260....270....280....290....300....310....320....330....340....350....360....370....380....390....400....410....420....430....440....450....460....470....480....490....500....510....520....530....540....550....560....570....580....590
…………中间省略………………
3810....3820....3830....3840....3850....3860....3870....3880....3890....3900....3910....3920....3930....3940....3950....3960....3970....3980....3990....4000....4010....4020....4030....4040....4050....4060....4070 done.
Fetching 35 files... ....10....20....30.. done. # 打补丁,需要等待约 5 分钟
Attempting to automatically merge changes in files... done.
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)? # 输入 y 回车,这里在确认系统文件的变动。
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/share/examples/sound/basic.c
/usr/share/examples/sound/ossinit.h
/usr/share/examples/sound/ossmidi.h
/usr/share/man/man9/ifaddr_byindex.9.gz
/var/db/etcupdate/log
/var/db/locate.database
(END) # 这里输入 q,确认变动
The following files will be added as part of updating to
14.2-RELEASE-p0:
/boot/kernel/bnxt_re.ko
/boot/kernel/gpioaei.ko
/boot/kernel/if_rtw89.ko
/boot/kernel/linuxkpi_video.ko
/boot/kernel/mac_do.ko
/boot/kernel/snd_dummy.ko
/etc/devd/autofs.conf
/usr/bin/mdo
/usr/bin/mididump
/usr/include/sys/splash.h
/usr/lib/debug/boot/kernel/bnxt_re.ko.debug
/usr/lib/debug/boot/kernel/gpioaei.ko.debug
/usr/lib/debug/boot/kernel/if_rtw89.ko.debug
/usr/lib/debug/boot/kernel/linuxkpi_video.ko.debug
/usr/lib/debug/boot/kernel/mac_do.ko.debug
/usr/lib/debug/boot/kernel/snd_dummy.ko.debug
/usr/libexec/bsdinstall/firmware
/usr/libexec/fwget/pci_network_intel
/usr/share/examples/oci
/usr/share/examples/oci/Containerfile.pkg
/usr/share/examples/oci/README
/usr/share/examples/sound/oss/README
/usr/share/examples/sound/oss/audio.c
/usr/share/examples/sound/sndstat_nv.c
: # 这里输入 q,确认变动,直至没有新内容出现
…………中间省略………………
The following files will be updated as part of updating to
14.2-RELEASE-p0:
/bin/[
/bin/cat
/bin/chflags
/bin/chio
/bin/chmod
/bin/cp
/bin/cpuset
/bin/csh
/bin/date
/bin/dd
/bin/df
/bin/domainname
/bin/echo
/bin/ed
/bin/expr
/bin/freebsd-version
/bin/getfacl
/bin/hostname
/bin/kenv
/bin/kill
/bin/link
/bin/ln
/bin/ls
/bin/mkdir
To install the downloaded upgrades, run 'freebsd-update [options] install'.
运行 freebsd-update install 以安装更新:
root@ykla:/home/ykla # 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
'freebsd-update [options] install' again to finish installing updates.
内核更新已经安装,系统要求重启:
root@ykla:/home/ykla # reboot
运行 freebsd-update install 安装用户空间的更新部分:
root@ykla:/home/ykla # 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: 868.
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.
重装 pkg:
root@ykla:/home/ykla # pkg bootstrap -f
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y # 此处输入 y 后回车
Bootstrapping pkg from https://mirrors.nju.edu.cn/freebsd-pkg/FreeBSD:14:amd64/latest, please wait... # 我换过 pkg 源,你可能和我不一样,没有问题
Installing pkg-1.21.3...
package pkg is already installed, forced install
Extracting pkg-1.21.3: 100%
检查第三方软件 ABI 变化(FreeBSD ABI 非常稳定,一般不会出错):
root@ykla:/home/ykla # pkg upgrade
root@ykla:/home/ykla # pkg upgrade
Updating nju repository catalogue...
Fetching meta.conf: 0%
Fetching data.pkg: 100% 7 MiB 7.6MB/s 00:01
Processing entries: 100%
nju repository update completed. 35765 packages processed.
All repositories are up to date.
Updating database digests format: 100%
Checking for upgrades (215 candidates): 100%
Processing candidates (215 candidates): 100%
The following 223 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
ceres-solver: 2.2.0_10
glib-networking: 2.80.0
libsoup3: 3.2.2
openjph: 0.18.0
py311-pygobject: 3.50.0
py311-truststore: 0.10.0
pygobject-common: 3.50.0
suitesparse-cxsparse: 4.4.0
suitesparse-spqr: 4.3.3_1
webrtc-audio-processing: 1.3
Installed packages to be UPGRADED:
AppStream: 1.0.1 -> 1.0.3_1
AppStreamQt5: 1.0.1 -> 1.0.3
…………中间省略………………
zh-fcitx5-chinese-addons: 5.1.6 -> 5.1.7_1
zh-libime: 1.1.8 -> 1.1.9_1
Installed packages to be REINSTALLED:
gcc13-13.3.0 (provided shared library changed)
kig-23.08.5_2 (required shared library changed)
py311-httpx-0.27.2 (option added: ZSTD)
Number of packages to be installed: 10
Number of packages to be upgraded: 210
Number of packages to be reinstalled: 3
The process will require 45 MiB more space.
687 MiB to be downloaded.
Proceed with this action? [y/N]: # 此处输入 y 再回车即可
…………以下省略………………