Homebrew是Mac OS X上没有包管理器,Homebrew官网上也有详细的安装和使用方法
安装
- Homebrew需要Command Line Tools for Xcode环境,如果安装了Xcode不需再次安装,可跳过这一步,否则请打开终端输入以下代码完成安装:
$ xcode-select --install
- 安装Homebrew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- 安装Homebrew的扩充
homebrew-cask是对Homebrew的扩充,其基本用法与brew相同,只不过在brew后面加了一个cask单词
安装
brew install caskroom/cask/brew-cask
安装软件
brew cask install google-chrome
卸载软件
brew cask uninstall google-chrome
基本使用
- 查看版本:
$ brew -v
- 更新
$ brew update # 更新Homebrew
$ brew update && brew upgrade # 同时更新已下载的软件
- 安装软件
brew install wget # brew install PKG_NAME
- 卸载软件
brew uninstall wget # brew uninstall PKG_NAME
- 其它命令可调用help命令查看
brew help
可调出如下提示
Example usage:
brew search [TEXT|/REGEX/]
brew (info|home|options) [FORMULA...]
brew install FORMULA...
brew update
brew upgrade [FORMULA...]
brew uninstall FORMULA...
brew list [FORMULA...]
Troubleshooting:
brew config
brew doctor
brew install -vd FORMULA
Developers:
brew create [URL [--no-fetch]]
brew edit [FORMULA...]
http://docs.brew.sh/Formula-Cookbook.html
Further help:
man brew
brew help [COMMAND]
brew home