Unix / BSD / Linux

FreeBSD6.2 -> FreeBSD8.1 Upgradeの手順

FreeBSD6.2 -> 8.1 Upgrade の 手順

3回再起動が必要になります。
FreeBSD6.3 以降であれば、freebsd-update -r 8.1-RELEASE upgrade で即アップグレード可能ですが、
FreeBSD6.2以前の場合は upgrade オプションが無いため、一旦6.3にした後8.1にアップグレードしました。

以下参照。



[admin@bsd6 ~]$ su -
Password:
[root@bsd6 ~]# mkdir DL
[root@bsd6 ~]# mkdir DL/update
[root@bsd6 ~]# uname -r
6.2-RELEASE

[root@bsd6 ~]# cd DL/update/
[root@bsd6 ~/DL/update]# wget http://people.freebsd.org/~cperciva/freebsd-update-upgrade.tgz
[root@bsd6 ~/DL/update]# tar xzf freebsd-update-upgrade.tgz
[root@bsd6 ~/DL/update]# ls
freebsd-update-upgrade.tgz      freebsd-update.sh
freebsd-update.conf

[root@bsd6 ~/DL/update]# sh freebsd-update.sh -f freebsd-update.conf -r 6.3-RELEASE upgrade
Looking up update.FreeBSD.org mirrors... 4 mirrors found.
Fetching public key from update5.FreeBSD.org... done.
Fetching metadata signature for 6.2-RELEASE from update5.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 2 metadata files... done.
Inspecting system... done.

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 update5.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...


[root@bsd6 ~/DL/update]# 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.

[root@bsd6 ~/DL/update]#/sbin/shutdown -r now

[root@bsd6 ~]# cd DL/update/
[root@bsd6 ~/DL/update]# sh freebsd-update.sh -f freebsd-update.conf install
Installing updates... done.
[root@bsd6 ~/DL/update]# /sbin/shutdown -r now

[root@bsd6 ~]# uname -r
6.3-RELEASE-p13

------------------------------------------------------------------------------

ここから8.1へアップグレードして行きます。

[root@bsd6 ~]# freebsd-update -r 8.1-RELEASE upgrade
Looking up update.FreeBSD.org mirrors... 4 mirrors found.
Fetching metadata signature for 6.3-RELEASE from update4.FreeBSD.org... done.
Fetching metadata index... done.
Inspecting system... done.

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 8.1-RELEASE from update4.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 6.3-RELEASE for merging... done.
Preparing to download files... done.
Fetching 8642 patches.....

Applying patches... done.
Fetching 7962 files...

--- 設定ファイルの手動編集 ---
--- 省略  ---

[root@bsd6 ~]# freebsd-update -r 8.1-RELEASE install
Installing updates...

Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.
[root@bsd6 ~]# /sbin/shutdown -r now

[root@bsd6 ~]# freebsd-update install
Installing updates...

Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/usr/sbin/freebsd-update install"
again to finish installing updates.

[root@bsd6 ~]# portsnap fetch
[root@bsd6 ~]# portsnap update
[root@bsd6 ~]# pushd /usr/ports/ports-mgmt/portupgrade
[root@bsd6 ~]# make
[root@bsd6 ~]# make install
[root@bsd6 ~]# make install clean


[root@bsd6 ~]# vi portsupdate.sh
--------
#!/bin/sh

portsdb -Uu
pkgdb -aF
portversion -v
#portupgrade -ra
portversion -c > update.sh
chmod +rx update.sh
sh ./update.sh
portsclean -CDP
--------

[root@bsd6 ~]# chmod +rx portsupdate.sh
[root@bsd6 ~]# ./portsupdate.sh

以上。

まぁ、再起動出来ないHostの場合は代替機を用意して、差し替えて運用する必要がありますな。

このページの先頭へ