运行
$brew doctor
可查看失败原因。
homebrew-core 和homebrew-cash失败,则试着运行
$git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
$git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
如果上面不行,请尝试:
$cd /usr/local/Homebrew/Library/Taps/homebrew/
$rm -rf homebrew-core
$git clone https://github.com/Homebrew/homebrew-core.git
如果更新homebrew-core还是失败,请尝试
$brew update-reset
如果报错443之类,请替换git源。友情链接
https://www.jianshu.com/p/b26c7bc14440
https://www.cnblogs.com/sanmubai/p/13160791.html
安装homebrew,请参考
https://cloud.tencent.com/developer/article/1759415
如果还是有问题,可与我联系。