替换Homebrew源为中科大镜像

国内homebrew使用体验很的很差,主要问题是访问github速度太慢,经常卡死在update.
替换为中科大镜像,立即起飞.
首先替换Git repo

替换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.git:
cd "$(brew --repo)/Library/Taps/caskroom/homebrew-cask"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

然后替换Bottles

对于bash用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

对于zsh用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: 替换Homebrew源为中科大镜像

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据