Mac版 brew install 失败解决方案(M1)
勾上此选项,安装完后切记!! 取消掉此选项(个人也不知道为什么)。
更换下载源
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
brew update
#设置环境变量 以zsh为例
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
更换回原始下载源
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.git
brew update
# 删除 ~/.zshrc 中的 HOMEBREW_BOTTLE_DOMAIN 这个变量
source ~/.zshrc