ports

FreeBSDのportsはaptとかyumとは少し趣が違って、ソースを落として自分でコンパイルする仕組み(だといいなぁ)。
FreeBSDを導入時によく使うのでメモ程度に。

portsツリー

portsシステムにおけるソフトウェアの一覧。

日本語環境でハンガリー語とかベトナム語は使わないから最初に削っておく。

# echo "REFUSE arabic chinese french german hebrew hungarian" >> /etc/portsnap.conf
# echo "REFUSE korean polish portuguese russian ukrainian vietnamese" >> /etc/portsnap.conf

初回はportsツリーが無いので一から作成。

# portsnap fetch extract

2回目以降は差分だけアップデート

# portsnap fetch update

普段の使い方

  • 目的のportsを探す。
  • ディレクトリ移動
  • make install clean
    • make config-recursiveを先に使用することで、依存関係先のmakeコンフィグも一括で先に設定できる。お茶でも飲もう。

例:openssh-portable

# whereis openssh-portable
openssh-portable: /usr/ports/security/openssh-portable
# cd /usr/ports/security/openssh-portable
# make install clean

基本的にディレクトリを探しているだけなので、Linuxでは確かこんな名前だったなぁ。
とか言いながら探した後にwhereisしてもいいと(俺は)思う。
この辺はapt-cacheを使うのと似てる。(原始的という意見もある。)

例:squidの場合

# ls /usr/ports/* | grep squid
squid3.1
squidclamav
lightsquid
squid
squid30
squid31
squid_radius_auth
squidguard
squidpurge
squidstats
squidview
# whereis squid31
squid31: /usr/ports/www/squid31
# cd /usr/ports/www/squid31
# make install clean

パッチがbrokenになったとき

例えば、以下のようなメッセージが出力された場合

# pkg_replace openssh-portable
--->  Replacing 'openssh-portable-5.2.p1_3,1' with 'openssh-portable-5.8.p2,1'
--->  Building '/usr/ports/security/openssh-portable'
===>  openssh-portable-5.8.p2,1 is marked as broken: latest upstream sftp file control public key patch is not up to date for OpenSSH 5.8p2.
*** Error code 1

make configを行い、(broken)と付いたパッチのチェックを外して([X] → [ ])、再度makeしてみること。

os/freebsd/ports/start.txt · 最終更新: 2011/11/04 05:41 by yuki
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0