Skip to content

Instantly share code, notes, and snippets.

@july-12
Last active January 2, 2020 03:31
Show Gist options
  • Save july-12/d51720a312c789057830f9010c23dc6a to your computer and use it in GitHub Desktop.
Save july-12/d51720a312c789057830f9010c23dc6a to your computer and use it in GitHub Desktop.
替换homebrew镜像源
当我们brew update或者brew install xxx时,异常的慢,本事原因还是国内网络环境github下载慢导致。
我们可以更换Homebrew源, 从https://mirrors.ustc.edu.cn/上搜索各对应的源
cd "$(brew --repo)" (正常放置在/usr/local/Homebrew)
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git/
# 替换homebrew-core
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 https://mirrors.ustc.edu.cn/homebrew-cask.git/
# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment