さくらの VPS の FreeBSD 設定 01

インストール直後は、ソフトウェアをインストールするためのデータがないため、最初にすることは「portsnap」コマンドを実行し、port ツリーを展開する作業になる。port ツリーは「/usr」直下に展開される。

# ls -la /usr/
total 56
drwxr-xr-x  17 root  wheel      512 Nov  7 12:58 .
drwxr-xr-x  19 root  wheel      512 Nov  8 16:28 ..
drwxrwxr-x   2 root  operator   512 Nov  8 00:51 .snap
drwxr-xr-x   2 root  wheel     7168 Nov  8 11:33 bin
drwxr-xr-x   2 root  wheel      512 Nov  7 21:37 compat
drwxr-xr-x   2 root  wheel      512 Nov  7 21:37 games
drwxr-xr-x   5 root  wheel      512 Nov  9 23:56 home
drwxr-xr-x  47 root  wheel     5120 Jul 19 11:24 include
drwxr-xr-x   6 root  wheel     9216 Jul 19 11:57 lib
drwxr-xr-x   5 root  wheel      512 Jul 19 11:23 libdata
drwxr-xr-x   5 root  wheel     1536 Jul 19 11:24 libexec
drwxr-xr-x  13 root  wheel      512 Nov  7 13:32 local
drwxr-xr-x   2 root  wheel      512 Nov  7 21:37 obj
drwxr-xr-x   2 root  wheel     5120 Jul 19 11:24 sbin
drwxr-xr-x  25 root  wheel      512 Nov  7 21:37 share
drwxr-xr-x   2 root  wheel      512 Jul 19 11:23 src

上記の表示のように「portsディレクトリはない。

port ツリーを取得して展開する

その前に不要な port を取得したくない場合は、「/etc/portsnap.conf」で設定をしてディスクの消費を抑える。ただし、この設定は必須ではない
初期設定では取得しない port 群は下記のようになっている。

# less /etc/portsnap.conf
# Example of ignoring parts of the ports tree.  If you know that you
# absolutely will not need certain parts of the tree, this will save
# some bandwidth and disk space.  See the manual page for more details.
#
# WARNING: Working with an incomplete ports tree is not supported and
# can cause problems due to missing dependencies.  If you have REFUSE
# directives and experience problems, remove them and update your tree
# before asking for help on the mailing lists.
#
REFUSE arabic chinese french german hebrew hungarian japanese
REFUSE korean polish portuguese russian ukrainian vietnamese

私の場合は、日本語「japanese」のみを除外対象から外している。変更後は次のようになる。

REFUSE arabic chinese french german hebrew hungarian
REFUSE korean polish portuguese russian ukrainian vietnamese

port ツリーを取得して展開する。この作業は通常、インストール直後の1回のみである。

# portsnap fetch extract update

port ツリーは毎日更新されているので、port ツリーを最新版にしたい場合は、1日に1回アップデートをする。

# portsnap fetch update

これで常に最新の状態になる。