brew使用國內鏡像源
這里用中科大的,另外還有清華的可用
# 步驟一
cd $(brew --repo)
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
# 步驟二
cd $(brew --repo)/Library/Taps/homebrew/homebrew-core
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
#步驟三
brew update
注意這里需要等待一會,因為要更新資源。
更新完后使用brew update,brew install速度變快很多了,不會卡在那半天沒動靜,替換鏡像完成。
cd $(brew --repo)
git remote set-url origin https://github.com/Homebrew/brew.git
cd $(brew --repo)/Library/Taps/homebrew/homebrew-core
git remote set-url origin https://github.com/Homebrew/homebrew-core
brew update
brew安裝出錯 可以使用下面方式
https://gitee.com/cunkai/HomebrewCN
HomebrewCN
Homebrew 國內自動安裝腳本
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"