1、解决方案
1、清理缓存
brew cleanup
2、 切换国内源
vim /Users/zhanghongyu21/.zprofile
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
3、关闭自动更新
vim /Users/xxx/.zprofile
sudo vim ~/.bash_profile
export HOMEBREW_NO_AUTO_UPDATE=true
source ~/.bash_profile
4、卸载重新安装
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"