portsを最新にする。

http://archive.side2.net/wiki/index.php?Computer%2FFreeBSD%2Fcvsup
を参考に
portversion -v
を実行してみると下記のようなエラーになる。

www# portversion -v
[Updating the pkgdb in /var/db/pkg ... /var/db/pkg/pkgdb.db: unexpected file type or format -- Invalid argument; rebuild needed] [Rebuilding the pkgdb in /var/db/pkg ... [Updating the pkgdb in /var/db/pkg ... /var/db/pkg/pkgdb.db: unexpected file type or format -- Invalid argument; rebuild needed] [Rebuilding the pkgdb in /var/db/pkg ... /var/db/pkg/pkgdb.db: unexpected file type or format -- Invalid argument: Cannot update the pkgdb!]: Cannot update the pkgdb!]
Command failed [exit code 1]: /usr/local/sbin/pkgdb -aFOQ


http://archive.side2.net/wiki/index.php?Computer%2FFreeBSD%2Fcvsup
http://blog.portwrite.jp/2006/07/portupgrade.html
を参考にして下記のコマンドを実行する。

www# rm /var/db/pkg/pkgdb.db /usr/ports/INDEX*.db


再度、portversion -v を実行した結果はこれ。

www# portversion -v
[Rebuilding the pkgdb in /var/db/pkg ... - 49 packages found (-0 +49) ................................................. done]
[Updating the portsdb in /usr/ports ... - 17594 port entries found .........1000.........2000.........3000.........4000.........5000.........6000.........7000.........8000.........9000.........10000.........11000.........12000.........13000.........14000.........15000.........16000.........17000..... ..... done]
apache-1.3.36 < needs updating (port has 1.3.37_4)
cvsup-without-gui-16.1h_2 < needs updating (port has 16.1h_3)
db41-4.1.25_4 = up-to-date with port
drac-1.12_4 < needs updating (port has 1.12_7)
expat-2.0.0_1 = up-to-date with port
freetype2-2.1.10_3 < needs updating (port has 2.2.1_2)
gd-2.0.33_4,1 < needs updating (port has 2.0.35,1)
gettext-0.14.5_2 < needs updating (port has 0.16.1_3)
gmake-3.80_2 < needs updating (port has 3.81_2)
imake-6.9.0 < needs updating (port has 1.0.2_4,1)
ja-Canna-3.7p3 = up-to-date with port
ja-elvis-1.8.4_1 = up-to-date with port
ja-groff-1.18.1_8 < needs updating (port has 1.18.1_10)
ja-less+iso-382.258 < needs updating (port has 382.262)
ja-man-1.1j_5 < needs updating (port has 1.1j_6)
ja-man-doc-5.4.20050911 = up-to-date with port
ja-nkf-2.05 < needs updating (port has 2.0.7,1)
ja-p5-Jcode-2.03 < needs updating (port has 2.06)
ja-qkc-1.0 = up-to-date with port
jpeg-6b_4 = up-to-date with port
lha-1.14i_6 = up-to-date with port
libiconv-1.9.2_2 = up-to-date with port
libtool-1.5.22_2 < needs updating (port has 1.5.22_4)
m4-1.4.4 < needs updating (port has 1.4.9)
mod_php4-4.4.2_1,1 > succeeds port (port has 4.4.7_1)
p5-Authen-PAM-0.16_1 = up-to-date with port
p5-Digest-1.15 = up-to-date with port
p5-Digest-MD5-2.36 = up-to-date with port
p5-MIME-Base64-3.07 = up-to-date with port
p5-Net-SSLeay-1.30_1 = up-to-date with port
perl-5.8.7_2 < needs updating (port has 5.8.8)
pkg_install-20060113 = up-to-date with port
pkg_remove-1.1 = up-to-date with port
pkg_tree-1.1_1 = up-to-date with port
pkgconfig-0.20 < needs updating (port has 0.22)
png-1.2.8_3 < needs updating (port has 1.2.18)
portaudit-0.5.10 < needs updating (port has 0.5.11)
portupgrade-2.3.1,2 = up-to-date with port
procmail-3.22_6 = up-to-date with port
qpopper-4.0.8 < needs updating (port has 4.0.9_1)
rc_subr-1.31_1 = up-to-date with port
rsync-2.6.7_1 < needs updating (port has 2.6.9_1)
ruby-1.8.4_5,1 < needs updating (port has 1.8.6_2,1)
ruby18-bdb-0.6.2 = up-to-date with port
ruby18-bdb1-0.2.2 < needs updating (port has 0.2.3)
ucd-snmp-4.2.6_4 < needs updating (port has 4.2.6_7)
unzip-5.52_2 < needs updating (port has 5.52_3)
webmin-1.260_2 < needs updating (port has 1.360)
wget-1.10.2 < needs updating (port has 1.10.2_1)
www#


portversionはインストールされている全てのportsのバージョンを確認するコマンド。
このへんの説明はここを参照
http://hiiro-sou.hp.infoseek.co.jp/unix/tips/portsupg.html


">"はデータベースに矛盾があることが原因らしい。
portupgradeで使うportsのINDEXファイルを更新するためのコマンドportsdbを実行してみる。

www# portsdb -uU

かなり時間がかかりそうなので、こっちで実行。

www# portsdb -uU &
[1] 97596
www# Updating the ports index ... Generating INDEX.tmp - please wait..

実行されていることを確認し、しばらく待ち。

www# ps -au
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND


root 97596 0.0 1.9 9568 8528 p0 I 2:31PM 0:00.30 /usr/local/bin/ruby18 /usr/local/sbin/portsdb -uU


終了後にportversion -v を実行したが">"は無くならなかった。
そういうことではないのか?


portupgradeを実行する。
バージョンの古い"<"のportsを全てアップデートするには下記のようにコマンドを実行する。

www# portupgrade -a &

再度、portsdbを実行

www# portsdb -uU &

portversionの実行結果は変わるか?

www# portversion -v
apache-1.3.36 < needs updating (port has 1.3.37_4)
cvsup-without-gui-16.1h_2 < needs updating (port has 16.1h_3)
db41-4.1.25_4 = up-to-date with port
drac-1.12_4 < needs updating (port has 1.12_7)
expat-2.0.0_1 = up-to-date with port
ezm3-1.2_1 = up-to-date with port
freetype2-2.1.10_3 < needs updating (port has 2.2.1_2)
gd-2.0.33_4,1 < needs updating (port has 2.0.35,1)
gettext-0.14.5_2 < needs updating (port has 0.16.1_3)
gmake-3.80_2 < needs updating (port has 3.81_2)
imake-6.9.0 < needs updating (port has 1.0.2_4,1)
ja-Canna-3.7p3 = up-to-date with port
ja-elvis-1.8.4_1 = up-to-date with port
ja-groff-1.18.1_8 < needs updating (port has 1.18.1_10)
ja-less+iso-382.258 < needs updating (port has 382.262)
ja-man-1.1j_5 < needs updating (port has 1.1j_6)
ja-man-doc-5.4.20050911 = up-to-date with port
ja-nkf-2.05 < needs updating (port has 2.0.7,1)
ja-p5-Jcode-2.03 < needs updating (port has 2.06)
ja-qkc-1.0 = up-to-date with port
jpeg-6b_4 = up-to-date with port
lha-1.14i_6 = up-to-date with port
libiconv-1.9.2_2 = up-to-date with port
libtool-1.5.22_2 < needs updating (port has 1.5.22_4)
m4-1.4.4 < needs updating (port has 1.4.9)
mod_php4-4.4.2_1,1 > succeeds port (port has 4.4.7_1)
p5-Authen-PAM-0.16_1 = up-to-date with port
p5-Digest-1.15 = up-to-date with port
p5-Digest-MD5-2.36 = up-to-date with port
p5-MIME-Base64-3.07 = up-to-date with port
p5-Net-SSLeay-1.30_1 = up-to-date with port
perl-5.8.7_2 < needs updating (port has 5.8.8)
pkg_install-20060113 = up-to-date with port
pkg_remove-1.1 = up-to-date with port
pkg_tree-1.1_1 = up-to-date with port
pkgconfig-0.20 < needs updating (port has 0.22)
png-1.2.8_3 < needs updating (port has 1.2.18)
portaudit-0.5.10 < needs updating (port has 0.5.11)
portupgrade-2.3.1,2 = up-to-date with port
procmail-3.22_6 = up-to-date with port
qpopper-4.0.8 < needs updating (port has 4.0.9_1)
rc_subr-1.31_1 = up-to-date with port
rsync-2.6.7_1 < needs updating (port has 2.6.9_1)
ruby-1.8.4_5,1 < needs updating (port has 1.8.6_2,1)
ruby18-bdb-0.6.2 = up-to-date with port
ruby18-bdb1-0.2.2 < needs updating (port has 0.2.3)
ucd-snmp-4.2.6_4 < needs updating (port has 4.2.6_7)
unzip-5.52_2 < needs updating (port has 5.52_3)
webmin-1.260_2 < needs updating (port has 1.360)
wget-1.10.2 < needs updating (port has 1.10.2_1)
www#

変わってないような


試しにwgetだけアップグレードしてみる。

www# portupgrade wget

===> Cleaning for wget-1.10.2_1



http://www.gnu.org/software/wget/wget.html
===> Cleaning for wget-1.10.2_1

      • > Cleaning out obsolete shared libraries

[Updating the pkgdb in /var/db/pkg ... - 50 packages found (-0 +1) . done]

portversion の結果

www# portversion -v
apache-1.3.36 < needs updating (port has 1.3.37_4)
cvsup-without-gui-16.1h_2 < needs updating (port has 16.1h_3)



webmin-1.260_2 < needs updating (port has 1.360)
wget-1.10.2_1 = up-to-date with port

wgetが"="になってアップグレードされている。
とりあえず一つずつアップグレードするか。