把官網給的腳本拿下來 git
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_installgithub
這裏我替換成清華大學的鏡像,修改以下兩句: ruby
BREW_REPO = 「https://github.com/Homebrew/brew「.freeze
CORE_TAP_REPO = 「https://github.com/Homebrew/homebrew-core「.freeze bash
更改成這兩句 curl
BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git".freeze
CORE_TAP_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git".freezeurl
也能夠換成別家的。spa
/usr/bin/ruby brew_installblog
安裝成功後,輸入以下命令檢查是否安裝成功:homebrew
注,添加清華大學鏡像源:資源
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles'>> ~/.bash_profile
source ~/.bash_profile