網(wǎng)上關(guān)于mac下brew更換國內(nèi)源的文章很多型宝,但是照做之后八匠,發(fā)現(xiàn)還是很慢
多次嘗試之后絮爷,發(fā)現(xiàn)是少做了一步
使用中科大的鏡像
替換默認源
第一步,替換brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
第二步:替換homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
第三步:替換homebrew-cask默認源(很多教程沒有這步)
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-cask.git
第四步:替換homebrew-bottle默認源(很多教程沒有這步)
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bashrc
source ~/.bashrc
最后使用
// 啰嗦模式查看更新進度
brew update --verbose