美文网首页
mac brew更换国内源

mac brew更换国内源

作者: aimleo | 来源:发表于2020-04-06 12:26 被阅读0次

网上关于mac下brew更换国内源的文章很多,但是照做之后,发现还是很慢

多次尝试之后,发现是少做了一步

使用中科大的镜像
替换默认源
第一步,替换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 

相关文章

网友评论

      本文标题:mac brew更换国内源

      本文链接:https://www.haomeiwen.com/subject/rggvphtx.html