FreeBSD 8.4 RELEASE - ports - ports を最新に保つ方法
2021年4月以降、「ports」のリポジトリが「Subversion」から「Git」へ移行しました。
それに伴い、「ports」を最新に保つ方法も変わりましたので、詳細は「「メンテナンス・トラブルシュート - pkg・ports - Subversion から Git へ」」をご参照ください。
- 1. portsnap
- 2. portsdb
- 3. portversion
- 4. ports のアップグレード
1. portsnap
仕掛けとして、portsnap というコマンドとそれに関連するコマンドを使用します。
以前のバージョンでは、portsnap 自体を ports でインストールする必要がありましたが、FreeBSD 8.4-RELEASE では、デフォルトでインストールされています。
まずは fetch というオプションで最新のスナップショットを取得します。
> portsnap fetch
fetch が終了したら、システムインストール後はじめての portsnap の場合は
> portsnap extract
というオプションを使用します。一度、extract を行った後は、fetch の後は
> portsnap update
というオプションを使用します。
実は、システムのバージョンが最新のリリースと大きく異なってくると portsnap では取得できないことがあります。実は
/etc/portsnap.conf
というファイルにその記載があり、バージョンの記載がない場合は、これを編集する必要があります。
/etc/portsnap.conf の中に portsnap の対象外にする項目を指定できます。
# REFUSE arabic chinese french german hebrew hungarian japanese
# REFUSE korean polish portuguese russian ukrainian vietnamese
の記述の箇所がそうなのですが、これは、各言語のうち対象外のものを除外したいときに有効にします。先頭の # をはずして、japanese の表記だけを削除するようにしましょう。
2. portsdb
次に使用している ports のデータベースを構築したり更新したりします。
これには portsdb という、コマンドを使用しますが、このコマンドは portupgrade という ports の中にあります。
/usr/ports/ports-mgmt/portupgrade
にありますので、make、make install します。
実は、このときに perl の最新版がインストールされます。FreeBSD 7.2 RELEASE 以前では、perl が標準でインストールされていましたが、それ以降、標準ではインストールされなくなりました。
しかし、FreeBSD (いやそれ以外の unix でも?) では多くのコマンドに perl を必要としますので、結局インストールすることになると思います。
データベースの生成、更新には portsdb -Uu というオプションを使用するのですが、これが結構時間かかるので
> portsdb -Fu
というオプションで代用します。実際にはこれで十分、動作するようです。
3. portversion
インストールしている ports の状況を調べるには、上記までを実行した後に portversion というコマンドを使用します。
> portversion -v
結果として以下のような表示になります。
[Rebuilding the pkgdb <format:bdb_btree> in /var/db/pkg ... - 17 packages found (-0 +17) ................. done]
autoconf-2.68 = up-to-date with port
autoconf-wrapper-20101119 = up-to-date with port
automake-1.11.1 = up-to-date with port
automake-wrapper-20101119 = up-to-date with port
db41-4.1.25_4 = up-to-date with port
gettext-0.18.1.1 = up-to-date with port
gmake-3.81_4 < needs updating (port has 3.82)
help2man-1.38.4 < needs updating (port has 1.40.4)
ja-freebsd-doc-20110110 < needs updating (port has 20110828)
libiconv-1.13.1_1 = up-to-date with port
libtool-2.2.10 < needs updating (port has 2.4)
m4-1.4.15,1 < needs updating (port has 1.4.16,1)
p5-Locale-gettext-1.05_3 = up-to-date with port
perl-5.10.1_3 < needs updating (port has 5.10.1_4)
portupgrade-2.4.8_1,2 < needs updating (port has 2.4.9.3,2)
ruby-1.8.7.302,1 < needs updating (port has 1.8.7.352_2,1)
ruby18-bdb-0.6.5_1 < needs updating (port has 0.6.6)
「=」マークがついていれば、最新版がインストールされている
「<」マークがついていれば、ports に新しい版が存在する(更新すべき?)
ということになります。
パッケージのインフォメーションとしてさらに詳しい情報を知りたい場合は、以下のコマンドを使用します。
> pkg_info
以下のような結果が出力されます。
autoconf-2.68 Automatically configure source code on many Un*x platforms
autoconf-wrapper-20101119 Wrapper script for GNU autoconf
automake-1.11.1 GNU Standards-compliant Makefile generator (1.11)
automake-wrapper-20101119 Wrapper script for GNU automake
db41-4.1.25_4 The Berkeley DB package, revision 4.1
gettext-0.18.1.1 GNU gettext package
gmake-3.81_4 GNU version of 'make' utility
help2man-1.38.4 Automatically generating simple manual pages from program o
ja-freebsd-doc-20110110 Japanese translation of the FreeBSD Documentation Project
libiconv-1.13.1_1 A character set conversion library
libtool-2.2.10 Generic shared library support script
m4-1.4.15,1 GNU m4
p5-Locale-gettext-1.05_3 Message handling functions
perl-5.10.1_3 Practical Extraction and Report Language
portupgrade-2.4.8_1,2 FreeBSD ports/packages administration and management tool s
ruby-1.8.7.302,1 An object-oriented interpreted scripting language
ruby18-bdb-0.6.5_1 Ruby interface to Sleepycat's Berkeley DB revision 2 or lat
4. ports のアップグレード
portversion で新しい版が出ている ports を更新するには、
> portupgrade portsの名称
というコマンドを使用します。
これに -R というオプションをつければ対象の ports に依存している ports も同時に更新できます。-r というオプションをつければ対象の ports が依存している ports も同時に更新できます。
いちいち ports を uninstall して、make、make install しなくてもよいので、便利といえば、便利なのですが、結構失敗することも多く、どこで失敗したのかがわかりにくいことがありますので、実際には、uninstall して、make、make install するほうが確実なようです。
|
|