安裝brew:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
更換國內(nèi)源
$ cd "$(brew --repo)"
$ git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
默認(rèn)不安裝cask 有需要的可以替換
$ cd "/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask"
$ git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-cask.git
更新brew
brew update
替換bintray鏡像,在你的bash配置文件后加上:export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles, 以zsh為例:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc
操作命令
通過 brew 可以查看命令列表
$ brew
Example usage:
brew search [TEXT|/REGEX/]
brew info [FORMULA...]
brew install FORMULA...
brew update
brew upgrade [FORMULA...]
brew uninstall FORMULA...
brew list [FORMULA...]
管理服務(wù)
brew services 查看基本用法

image