因为你的Mac绝大部分可能会在你手上,而不是像Linux服务器一样身处海外,所以GitHub下载地址处于失联状态
我找到的安装一件脚本,适用于国内
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
运行时会提示你安装源选择,换源选择。好喜欢傻瓜操作啊,省时省力,多来点,多来点!
现在运行
brew update
提示一个报错,我们记下这三个路径
然后运行
git config --global --add safe.directory homebrew-cask路径
git config --global --add safe.directory homebrew-core路径
git config --global --add safe.directory homebrew-services路径
再次更新源
运行
brew update
此时若长时间未响应,则脚本换源失败
我们只需要执行
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
以手动换源
即可!
Comments | NOTHING