Homebrew インストールしてみました。Mavericks

001パッケージマネージャのHomebrewをインストールの備忘録です。

Homebrewとは?

マックのパッケージマネージャーです。もともとMacportsとかありますが、それよりもお手軽に行えるよう考えられているらしい。

Homebrewダウンロード

Homebrewのサイトの下の方にあるコマンドをコピーしてターミナルにペーストしてreturnキーを押すとインストールされます。

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

インストールの確認

Homebrew が正しくインストールされていることを確認します。

brew doctor

私の環境では、4つのエラーが出ました。

Unexpected dylibs:
/usr/local/lib/libmacfuse_i32.2.dylib
/usr/local/lib/libmacfuse_i64.2.dylib
/usr/local/lib/libosxfuse_i32.2.dylib
/usr/local/lib/libosxfuse_i64.2.dylib
/usr/local/lib/libusb-1.0.0.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
/usr/local/lib/libosxfuse_i32.la
/usr/local/lib/libosxfuse_i64.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
/usr/local/lib/pkgconfig/osxfuse.pc

Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

git
git-cvsserver
git-receive-pack
git-shell
git-upload-archive
git-upload-pack
Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile

Unexpected–要らないファイル

Unexpected–要らないファイルだという警告なので、順番に消していきます。

rm -rf /usr/local/lib/libmacfuse_i32.2.dylib
rm -rf /usr/local/lib/libmacfuse_i64.2.dylib
rm -rf /usr/local/lib/libosxfuse_i32.2.dylib
rm -rf /usr/local/lib/libosxfuse_i64.2.dylib
rm -rf /usr/local/lib/libusb-1.0.0.dylib
rm -rf /usr/local/lib/libosxfuse_i32.la
rm -rf /usr/local/lib/libosxfuse_i64.la
rm -rf /usr/local/lib/pkgconfig/osxfuse.pc
rm -rf /usr/local/lib/libmacfuse_i32.2.dylib

パスの設定

.bashrc および .bash_profile が自分のカレントユーザにあるか確認

ls -a

なければ作成

touch .bash_profile .bashrc

.bash_profileに、追加

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

.bashrcに、【PATH=/usr/local/bin:$PATH】を足します。

export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/sbin:$PATH

リンク切れを修正

再び、

brew doctor

を実行すると、リンク切れのメッセージが出ました。

Warning: Broken symlinks were found. Remove them with `brew prune`:
/usr/local/lib/libosxfuse_i64.dylib
/usr/local/lib/libosxfuse_i32.dylib
/usr/local/lib/libosxfuse.dylib
/usr/local/lib/libosxfuse.2.dylib
/usr/local/lib/libmacfuse_i64.dylib
/usr/local/lib/libmacfuse_i32.dylib
/usr/local/lib/libfuse_ino64.dylib
/usr/local/lib/libfuse_ino64.2.dylib
/usr/local/lib/libfuse.dylib
/usr/local/lib/libfuse.2.dylib
/usr/local/lib/libfuse.0.dylib
/usr/local/lib/pkgconfig/fuse.pc
/usr/local/lib/libosxfuse.la

以下のコマンドを実行すると良しなにしてくれます。

brew prune

成功するまでメッセージに従う

三度、brew doctor を実行し成功のメッセージが出てくるまで従います。

brew doctor
Your system is ready to brew.

完了したらアップデートしておきます

brew update

バージョンも確認しておきましょう。

brew -v

以上でインストールは完了です。
お疲れ様でした。

パッケージの導入について

パケージは【serch】と【install】のコマンドで行います。

rew search wget
brew install wget

コメント

タイトルとURLをコピーしました