FreeBSD ports 管理が、pkg_ から pkgng に変わってしまいました。
変わったと言っても、pkg を管理している/var/db 下のデータベース構造が変わっただけで、ports ディレクトリの管理は今まで通り portsnap や subversoin で行い、手動インストール・削除などは、make コマンド。一括更新コマンドも portupgrade や portmaster で行うため従来通り。
更新が発生したかどうかを確認するためのコマンドが、 pkg_xxxxx から pkg xxxxx に変化してコマンドから ‘_’ が無くなったくらいの違いで、24時間運用マシンを手動でメンテナンスしている私にとっては、データベースをコンバートしたことと、cron で実行しているコマンドをちょっと書き替える程度の違いです。
しかし、いつでもリブートできるテストマシンやデスクトップマシンでは事情が違います。
時々しか電源を入れないマシンでは、電源投入毎に数多くのパッケージが更新されている事が多々あります。そして、延々と ports パッケージのアップデートが始まります。こういう時に、バイナリーインストールを使って短時間でパッケージ更新出来るとありがたい。
さて、今回 FreeBSD 9.2 のホストを久しぶりに電源投入し、OSのパッチレベルを最新にし、pkgng を導入し、pkg upgrade コマンドを実行してみたところ、大量の更新情報が。さて、ここで Y を押すとどうなるのでしょう?
FreeBSD 9.2-RELEASE-p12
# pkg upgrade Updating FreeBSD repository catalogue... FreeBSD repository is up-to-date. All repositories are up-to-date. Checking for upgrades (111 candidates): 100% The following 136 packages will be affected (of 0 checked): New packages to be INSTALLED: db5: 5.3.28_2 libXi: 1.7.4,1 libXfixes: 5.0.1_2 wx28-gtk2-unicode: 2.8.12_4 libXxf86vm: 1.1.3_2 libXinerama: 1.1.3_2,1 wx28-gtk2-common: 2.8.12_4 pangox-compat: 0.0.2_1 pango: 1.34.1_7 libXrender: 0.9.8_2 libXft: 2.3.1_2 harfbuzz: 0.9.28 graphite2: 1.2.4 cairo: 1.12.16_1,2 xcb-util-renderutil: 0.3.9 xcb-util: 0.3.9_3,1 glib: 2.36.3_4 icu: 53.1 gtk2: 2.24.22_4 libXrandr: 1.4.2_2 libXdamage: 1.1.4_2 libXcursor: 1.1.14_2 libXcomposite: 0.4.4_2,1 cups-client: 1.7.3_2 shared-mime-info: 1.1_1 python: 2.7_2,2 gtk-update-icon-cache: 2.24.22 gdk-pixbuf2: 2.28.2_1 tiff: 4.0.3_4 jbigkit: 2.1_1 jasper: 1.900.1_14 atk: 2.8.0_1 gstreamer-plugins: 0.10.36_4,3 libXv: 1.0.10_2,1 gstreamer: 0.10.36_2 gobject-introspection: 1.36.0_3 orc: 0.4.21 libGLU: 9.0.0_2 libGL: 7.6.1_5 libdrm: 2.4.17_2,1 libpciaccess: 0.13.2_2 dbus-glib: 0.100.2_1 dbus: 1.8.6 polkit: 0.105_3 libIDL: 0.8.14_2 gconf2: 2.32.0_6 dconf: 0.14.1_1 ORBit2: 2.14.19_1 libmspack: 0.4_2 freeglut: 2.8.1_3 libnotify: 0.7.5_1 Installed packages to be UPGRADED: libiconv: 1.14_3 -> 1.14_4 wget: 1.15_1 -> 1.15_2 apr: 1.5.1.1.5.3_3 -> 1.5.1.1.5.3_4 mod_php5: 5.4.31,1 -> 5.4.32,1 libidn: 1.28_1 -> 1.28_2 python27: 2.7.8_3 -> 2.7.8_5 libgcrypt: 1.6.1_3 -> 1.6.1_5 pcre: 8.34_2 -> 8.35 php5: 5.4.31 -> 5.4.32 php5-mysql: 5.4.31 -> 5.4.32 php5-session: 5.4.31 -> 5.4.32 phpMyAdmin: 4.2.7.1 -> 4.2.8.1 t1lib: 5.1.2_3,1 -> 5.1.2_4,1 php5-gd: 5.4.31 -> 5.4.32 php5-xml: 5.4.31 -> 5.4.32 php5-ctype: 5.4.31 -> 5.4.32 php5-openssl: 5.4.31 -> 5.4.32 php5-mcrypt: 5.4.31 -> 5.4.32 php5-filter: 5.4.31 -> 5.4.32 php5-json: 5.4.31 -> 5.4.32 php5-mbstring: 5.4.31 -> 5.4.32 php5-mysqli: 5.4.31 -> 5.4.32 php5-zlib: 5.4.31 -> 5.4.32 php5-zip: 5.4.31 -> 5.4.32 php5-bz2: 5.4.31 -> 5.4.32 php5-xmlwriter: 5.4.31 -> 5.4.32 php5-xmlreader: 5.4.31 -> 5.4.32 php5-dom: 5.4.31 -> 5.4.32 php5-simplexml: 5.4.31 -> 5.4.32 php5-posix: 5.4.31 -> 5.4.32 php5-hash: 5.4.31 -> 5.4.32 php5-phar: 5.4.31 -> 5.4.32 php5-tokenizer: 5.4.31 -> 5.4.32 sqlite3: 3.8.5_1 -> 3.8.6 php5-sqlite3: 5.4.31_1 -> 5.4.32_1 php5-pdo_sqlite: 5.4.31_1 -> 5.4.32_1 php5-pdo: 5.4.31 -> 5.4.32 php5-iconv: 5.4.31 -> 5.4.32 ruby: 1.9.3.547,1 -> 1.9.3.547_3,1 libyaml: 0.1.6 -> 0.1.6_1 libffi: 3.0.13_1 -> 3.0.13_2 ruby19-bdb: 0.6.6_3 -> 0.6.6_4 readline: 6.3.6_1 -> 6.3.8 curl: 7.37.1_2 -> 7.38.0_1 ca_root_nss: 3.16.3 -> 3.17 boinc-client: 7.2.33_4 -> 7.2.33_5 pciids: 20140810 -> 20140911 cmake-modules: 2.8.12.1_1 -> 3.0.1_1 cmake: 2.8.12.1_4 -> 3.0.1_1 Installed packages to be REINSTALLED: xorg-fonts-truetype-7.7_1 (direct dependency changed) libxcb-1.10_2 (options changed) libX11-1.6.2_2,1 (direct dependency changed) libXext-1.3.2_2,1 (direct dependency changed) libXpm-3.5.11_2 (direct dependency changed) libXt-1.1.4_2,1 (direct dependency changed) gdbm-1.11_2 (direct dependency changed) apache24-2.4.10_1 (direct dependency changed) p5-Locale-gettext-1.05_3 (direct dependency changed) gettext-0.18.3.1_1 (direct dependency changed) gmake-3.82_1 (direct dependency changed) help2man-1.43.3_1 (direct dependency changed) python2-2_3 (direct dependency changed) xcb-proto-1.10_1 (direct dependency changed) libxslt-1.1.28_4 (direct dependency changed) autoconf-2.69 (direct dependency changed) m4-1.4.17_1,1 (options changed) automake-1.14 (direct dependency changed) php5-extensions-1.7 (options changed) libXp-1.0.2_2,1 (direct dependency changed) pecl-APC-3.1.14_1 (direct dependency changed) libXmu-1.1.2_2,1 (direct dependency changed) libXaw-1.0.12_2,2 (direct dependency changed) pecl-pdflib-3.0.4 (direct dependency changed) mkfontdir-1.0.7 (direct dependency changed) font-misc-ethiopic-1.0.3_1 (direct dependency changed) fontconfig-2.11.0_3,1 (options changed) font-bh-ttf-1.0.3_1 (direct dependency changed) font-misc-meltho-1.0.3_1 (direct dependency changed) bdftopcf-1.0.4 (direct dependency changed) libltdl-2.4.2_3 (direct dependency changed) ruby19-date2-4.0.19 (options changed) libexecinfo-1.1_3 (options changed) portupgrade-2.4.12_2,2 (direct dependency changed) bind99-9.9.5P1_5 (options changed) libtool-2.4.2_3 (direct dependency changed) The process will require 237 MB more space. 102 MB to be downloaded. Proceed with this action? [y/N]:
最初はバイナリーパッケージのダウンロードが約10分程度続き、その後約3分でインストールが完了。(Atom D2700にて。)
こいつは早い。と思うものの、 確認のために再度 pkg version -vL= を実行すると、更新が必要なパッケージリストが山のように出て来きました。
# pkg version -vL= apache24-2.4.10_1 < needs updating (index has 2.4.10_2) apr-1.5.1.1.5.3_4 < needs updating (index has 1.5.1.1.5.4) bind99-9.9.5P1_5 < needs updating (index has 9.9.6) cmake-3.0.1_1 < needs updating (index has 3.0.2) cmake-modules-3.0.1_1 < needs updating (index has 3.0.2) dbus-1.8.6 < needs updating (index has 1.8.8) libGL-7.6.1_5 < needs updating (index has 9.1.7_2) libdrm-2.4.17_2,1 < needs updating (index has 2.4.52_1,1) libgpg-error-1.13_1 < needs updating (index has 1.15) libmcrypt-2.5.8_1 < needs updating (index has 2.5.8_2) libpthread-stubs-0.3_5 < needs updating (index has 0.3_6) mod_php5-5.4.32,1 < needs updating (index has 5.4.33,1) mysql55-client-5.5.39 < needs updating (index has 5.5.40) mysql55-server-5.5.39 < needs updating (index has 5.5.40) pciids-20140911 < needs updating (index has 20140922) php5-5.4.32 < needs updating (index has 5.4.33) php5-bz2-5.4.32 < needs updating (index has 5.4.33) php5-ctype-5.4.32 < needs updating (index has 5.4.33) php5-dom-5.4.32 < needs updating (index has 5.4.33) php5-filter-5.4.32 < needs updating (index has 5.4.33) php5-gd-5.4.32 < needs updating (index has 5.4.33) php5-hash-5.4.32 < needs updating (index has 5.4.33) php5-iconv-5.4.32 < needs updating (index has 5.4.33) php5-json-5.4.32 < needs updating (index has 5.4.33) php5-mbstring-5.4.32 < needs updating (index has 5.4.33) php5-mcrypt-5.4.32 < needs updating (index has 5.4.33_1) php5-mysql-5.4.32 < needs updating (index has 5.4.33) php5-mysqli-5.4.32 < needs updating (index has 5.4.33) php5-openssl-5.4.32 < needs updating (index has 5.4.33) php5-pdo-5.4.32 < needs updating (index has 5.4.33) php5-pdo_sqlite-5.4.32_1 < needs updating (index has 5.4.33_1) php5-phar-5.4.32 < needs updating (index has 5.4.33) php5-posix-5.4.32 < needs updating (index has 5.4.33) php5-session-5.4.32 < needs updating (index has 5.4.33) php5-simplexml-5.4.32 < needs updating (index has 5.4.33) php5-sqlite3-5.4.32_1 < needs updating (index has 5.4.33_1) php5-tokenizer-5.4.32 < needs updating (index has 5.4.33) php5-xml-5.4.32 < needs updating (index has 5.4.33) php5-xmlreader-5.4.32 < needs updating (index has 5.4.33) php5-xmlwriter-5.4.32 < needs updating (index has 5.4.33) php5-zip-5.4.32 < needs updating (index has 5.4.33) php5-zlib-5.4.32 < needs updating (index has 5.4.33) phpMyAdmin-4.2.8.1 < needs updating (index has 4.2.9) pkg-1.3.7 < needs updating (index has 1.3.8) pkgconf-0.9.6_1 < needs updating (index has 0.9.7)
う~ん、今、更新をかけたばかりなのに、なぜ? と、よくよくバージョン情報をチェックしてみると、バイナリーインストールよりも新しくなっているソースパッケージばかり。つまり、portsサーバー上のパッケージバイナリーの更新が間に合っていないようです。
手動でビルド、インストールしてもいいのですが、単にバージョンがちょっと古いだけのパッケージが残っているだけなので、あわててにビルドする必要は無さそうです。脆弱性があると認識されているパッケージは、”pkg audit -F” で検出できるため、それがネットワークに公開されているパッケージの場合は、手動メンテナンスすれば良い事になります。
確認すべき点は、標準コンフィグでビルドされているはずのバイナリーパッケージが問題なく動くのかどうかという事。これに関しては少し使ってみないと分かりません。
ユーザーを抱えていないサーバーの場合、pkgng によるバイナリーパッケージ更新機能は大量の更新を短時間で行わなければならないシーンで有効と言えそうです。
<その後、観察された影響>
私の場合は boinc を動かしているので、早速問題発生。FreeBSDでBoincを動かし幅広いプロジェクトに対応するためには、FreeBSDバイナリーではなく、Linuxエミュレーションで動かすします。従って、ビルドオプションにLINUXを入れてないといけません。このことを考慮しないバイナリーパッケージでは、boincが動かなくなってしまいました。結局 /usr/ports/net/boinc-client にて、手動 make して再インストールすることになりました。