mac pro 13 m2,安装brew报错fatal: unable to access ‘https://github.com/Homebrew/brew/‘: Recv failure...

错误内容具体如下图:

mac pro 13 m2,安装brew报错fatal: unable to access ‘https://github.com/Homebrew/brew/‘: Recv failure..._第1张图片

 参考了不少解决方案,如:

https://github.com/orgs/Homebrew/discussions/666 ruby - Homebrew install: Failed during: git fetch origin master:refs/remotes/origin/master -n --depth=1 - Stack Overflow

Unable to install Homebrew on mac · Issue #46717 · Homebrew/legacy-homebrew · GitHub 

最终解决方案:

sudo rm -rf /opt/homebrew

rm ~/.gitconfig  

 不管有没有,都可以执行一下试试。

然后重新执行:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

即可安装成功。

mac pro 13 m2,安装brew报错fatal: unable to access ‘https://github.com/Homebrew/brew/‘: Recv failure..._第2张图片 

然后按照上图中的红框提示配置下环境变量即可正常使用Iterm2操作brew。

 

你可能感兴趣的:(macos,brew)