如何使用freebsd-update实用程序将FreeBSD 6.2升级到FreeBSD 6.3(次要更新)

时间:2020-01-09 10:44:00  来源:igfitidea点击:

问题描述:我已经安装了FreeBSD 6.2 p9,如何使用二进制更新方法将我的机器升级到最新的FreeBSD 6.3版本。
如何通过ssh会话升级我的设备?

解决方法:FreeBSD 6.3具有"称为freebsd-update"的新更新工具,该工具支持对运行较早FreeBSD发行版的i386和amd64系统进行二进制升级,候选发行版和Beta。
从较早版本(尤其是6.3-RC1之前的版本)升级到FreeBSD 6.3的用户将需要下载支持升级到新版本的freebsd-update(8)的更新版本。

"警告!"如果通过ssh会话执行或者中断了这些示例,则可能会使FreeBSD计算机崩溃。
在尝试执行这些说明之前,请同时备份数据和配置文件。

步骤1:找出当前的FreeBSD版本

$ uname -mrs

输出:

FreeBSD 6.2-RELEASE-p9 i386

步骤2:下载更新的freebsd-update

下载支持升级到新版本的freebsd-update实用程序的更新版本。

下载freebsd-update-upgrade软件包:

# fetch http://people.freebsd.org/~cperciva/freebsd-update-upgrade.tgz

下载gpg密钥以验证软件包:

# fetch http://people.freebsd.org/~cperciva/freebsd-update-upgrade.tgz.asc

验证软件包:

# gpg --verify freebsd-update-upgrade.tgz.asc freebsd-update-upgrade.tgz

解压缩包:

# tar -xf freebsd-update-upgrade.tgz

步骤3:使用freebsd-update启动更新过程

开始升级程序并下载所有最新文件/软件包,执行:

# sh freebsd-update.sh -f freebsd-update.conf -r 6.3-RELEASE upgrade

输出:

Looking up update.FreeBSD.org mirrors... 1 mirrors found.
Fetching metadata signature for 6.2-RELEASE from update1.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata files... done.
Inspecting system... 
The following components of FreeBSD seem to be installed:
kernel/generic world/base world/dict world/doc world/manpages

The following components of FreeBSD do not seem to be installed:
kernel/smp src/base src/bin src/contrib src/crypto src/etc src/games
src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue
src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin
world/catpages world/games world/info world/proflibs

Does this look reasonable (y/n)? y

Fetching metadata signature for 6.3-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.
Preparing to download files... done.
Fetching 6150 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....600....610....620....630....640....650....660....670....680....690....700....710....720....730....740....750....760....770....780....790....800....810....820....830....840....850....860....870....880....890....900....910....920....930....940....950....960....970....980....990....1000....1010....1020....1030....1040....1050....1060....1070....1080....1090....1100....1110....1120....1130....1140....1150....1160....1170....1180....1190....1200....1210....1220....
.......
..
....
/bin/rcp
/bin/realpath
/bin/red
/bin/rm
/bin/rmail
/bin/rmdir
/bin/setfacl
/bin/sh

安装下载的文件:

# sh freebsd-update.sh -f freebsd-update.conf install

输出:

Installing updates...
Kernel updates have been installed.  Please reboot and run
"freebsd-update.sh install" again to finish installing updates.

重新启动服务器:

# reboot

步骤4:安装Userland更新

您还需要升级其他userland软件包:

# sh freebsd-update.sh -f freebsd-update.conf install

输出:

Installing updates...

再次重新启动该框,执行:

# reboot

步骤5:验证更新

确保控制台或者日志文件上没有错误报告:

$ uname -mrs

输出:

FreeBSD 6.3-RELEASE i386

步骤6:更新应用程序/端口树

最后,您可能需要升级正在运行的应用程序,例如php,apache,openssh等。
只需使用portsnap和portmanager命令来更新所有已安装的软件包:

# portsnap fetch extract
# pkg_version -vIL=

现在升级已安装的端口:

# portmanager -u

或者

# portupgrade -a