brew install
パッケージと実行環境
書き方
brew install [--cask] <formula>macOSとLinuxで、あらかじめビルドされたbottleを取って入れます。画面のあるアプリは--cask、新しい版へ上げるのはinstallではなくbrew updateとbrew upgradeの仕事です。
よく使うオプション
| オプション | 意味 |
|---|---|
| --cask | install a GUI application instead of a formula |
| --formula | force the formula when a cask has the same name |
| --HEAD | build from the latest source instead of a release |
| --build-from-source | compile locally instead of using the bottle |
例
brew install ripgrepinstalls a prebuilt bottle in seconds
brew install --cask visual-studio-codeinstalls an app into /Applications
brew install node@22a versioned formula, keg-only until you brew link it
何をどこに入れるかが問題です。このプロジェクトの中か、マシン全体かを先に決めてください。
読み方
- 角括弧 [ ] は省いてよい部分です。
- 三点 … は複数並べられるという意味です。
- オプションは大文字小文字を区別します — -r と -R が別物のコマンドもあります。
よくある質問
Q. brew install は何をしますか。
macOSとLinuxで、あらかじめビルドされたbottleを取って入れます。画面のあるアプリは--cask、新しい版へ上げるのはinstallではなくbrew updateとbrew upgradeの仕事です。
Q. どう打ちますか。
brew install [--cask] <formula> — 角括弧は省いてよい部分です。
Q. よく使うオプションはいくつですか。
ここにまとめたのは4個です。全部は man brew にあります。このコマンドはパッケージと実行環境の仲間です。
関連するコマンド
man ページ: man brew-install