以前はMacのパッケージ管理にMacPortsを使っていたけど,homebrewの方がインストールサイズが小さくてすむので,こちらに乗り換えた。 以下はインストールメモ。
Command Line Tools for Xcode のインストール
xcode-select --install
brewコマンドのインストール
brewコマンドをインストールbrew doctor を実行し,エラーが出たら問題を解決しておく。解決方法は大抵エラーメッセージに書いてある。brew install --cask 実行時のインストールディレクトリの設定
~/Applicationにインストールされる。以下の1, 2行目はこれを/Applicationに変更する設定.$ echo "export HOMEBREW_CASK_OPTS=\"--appdir=/Applications\"" >> ~/.bash_profile
適当に必要なソフトを見繕ってインストール。
fish_config: ブラウザでカスタマイズfish_update_completions: 補完情報の更新$ brew install lv gnupg nkf rmtrash
$ brew install visual-studio-code
$ brew install pandoc markdown
$ brew install unar
$ brew install ffmpeg
$ brew install kryptco/tap/kr
$ brew install xonsh bash-completion2
$ brew install fish
$ brew install z
dmg形式として配布されているものには,brewで管理できるようパッケージ化されているものがある。
そのようなパッケージの管理にはbrew caskを使う。
$ brew install xquartz --cask # R, grace, その他いくつかのアプリで必要
$ brew install sublime-text --cask # エディタSublime Text 3
$ brew install google-japanese-ime --cask # google日本語入力
$ brew install qlmarkdown --cask # .md のQuickLookプレビュー
R は homebrew/science にあるものと,homebrew/caskにあるものがある。
後者をインストールすると,/usr/local/lib/以下にtcl/tk 関連のライブラリがインストールされ,これを消去するようにとhomebrew doctorがエラーを出す。実際に消すと,Rの実行に困る場合がある。
前者をインストールするとこの問題は無くなるが,gccやら何やら,わさわさとインストールしないといけなくなる(mpfr, libmpc, isl, gcc, gettext, pcre, pixman, libffi, glib, cairoがインストールされた…)。ここでは前者の方でインストールする。
$ brew install r # R言語
$ brew cask install rstudio # RStudio
gnuplot のインストールは brew cask で xquartz をインストールした後にする。
$ brew cask install aquaterm
$ brew install gnuplot --with-x11 --with-aquaterm
mackupは各種設定ファイルをDropbox経由で同期する設定をするツール。
$ brew install mackup
$ mackup backup <= macup新規導入時
$ mackup restore <= macupを他のマシンで利用開始時(既にあるmackupファイルを利用)
同期したいものを追加したい時には~/.mackup/<name>.cfgを追加。
Java Script環境のnode.jsを使えるようにする。 nodebrewをインストールして,あとはnpmで必要なものを追加。
$ brew install nodebrew
$ mkdir -p ~/.nodebrew/src
$ nodebrew install-binary latest
$ nodebrew use latest
$ echo 'export PATH=$PATH:~/.nodebrew/current/bin' >> ~/.bash_profile
$ brew outdated
$ brew cleanup -n # 削除されるformulaの一覧表示(削除はしない)
$ brew cleanup
$ brew info <formula name>
$ brew list
$ brew bundle dump
$ brew bundle
$ brew untap phinze/homebrew-cask
$ brew tap caskroom/homebrew-cask
/usr/local/lib/libusb-… は brew doctorで怒られるので,削除して,homebrewのlibusbをインストールする。$ brew install libusb