自分用の備忘録。
macのOSを、Snow LeopardからMountain Lionにアップグレードする際に、今まで利用していたMacPortsからHomebrewに移行してみた。
1. MacPorts経由でインストールしたものを出力しておく
$ port installed > installed-port.txt
2. MacPortsで導入したデーモンを取り除く
変換エンジン(Canna)を入れていたので。
$ sudo port unload canna
3. とその関連ファイルのアンインストール
$ sudo port -f uninstall installed $ sudo rm -rf /opt/local
4. Homebrewのインストール
ネットで色々調べてみたが、インストール先のURLは結構変わっているらしい。
2013.4.16現在ではhttp://mxcl.github.io/homebrew/で確認できる以下からインストールする。
$ ruby -e "curl fsSL https raw github com mxcl homebrew go"
5. 「brew doctor」して、インストールの一般的な問題をチェック
問題を解決していく過程で以下のようなwarningが出た。
5.1. Warning: Your Xcode (3.2.4) is outdated
元々HomebrewをインストールしようとしているmacのOSは、Snow LeopardからMountain Lionにアップグレードしたものだったので、Xcodeのバージョンが少し古かった。
AppStoreで最新のものをインストールして解決。
5.2. Warning: You have not agreed to the Xcode license.
5.1. でXcodeをインストール後、Xcodeを起動して承認画面まで進んでいないとこのエラーが出た。
5.3. Warning: No compiler found in /usr/bin!
Xcodeを最新版に変えたらエラーがなくなった。
5.4. Warning: Missing git origin remote.
5.3と同様
5.5. Warning: An outdated version of Git was detected in your PATH.
5.3と同様
5.6. Warning: You have MacPorts or Fink installed:
MacPortsはアンインストールしたんだけど、Finkはしてなかった。という事でFinkをアンインストールする。
$ sudo rm -rf /sw
5.7. Warning: Experimental support for using Xcode without the “Command Line Tools”.
Xcode Command Line Toolsがインストールされていなかったので、Xcodeを立ち上げて「Preference」>「Downloads」で「Command Line Tools」をインストール。
5.8. Warning: You have leftover files from an older version of Xcode.
古いバージョンのXcodeがあるようなので、指定されたコマンドでアンインストールする。
$ sudo /Developer/Library/uninstall-developer-folder
5.9. Warning: /usr/bin occurs before /usr/local/bin
bashrcで設定されている環境変数(PATH)の優先順位がおかしかった。
以下のように変更
PATH=/usr/local/bin:/usr/local/sbin:$PATH
これでbrew doctorが通った。
あとはbrew install XXXとかで必要なやつをインストールすればおk