Homebrew安装提示"Failed during: git fetch origin master:refs/remotes/origin/master --tags --force)"

症状

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Failed during: git fetch origin master:refs/remotes/origin/master --tags --force

解决方案:

1、将brew的install文件下载本地
      终端输入 curl -fsSL [https://raw.githubusercontent.com/Homebrew/install/master/install](https://raw.githubusercontent.com/Homebrew/install/master/install) >> brew_install

2、修改install文件的镜像源
终端输入 vim brew_install
将下面两行进行修改
#BREW_REPO = "[https://github.com/Homebrew/brew”.freeze](https://github.com/Homebrew/brew%E2%80%9D.freeze)
#CORE_TAP_REPO = “[https://github.com/Homebrew/homebrew-core](https://github.com/Homebrew/homebrew-core)”.freeze
替换成下面两句
BREW_REPO = “[https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git](https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git)”.freeze
CORE_TAP_REPO = "[https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git”.freeze](https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git%E2%80%9D.freeze)
#就是“BREW_REPO”和“CORE_TAP_REPO”这两项,将其修改为清华的镜像
3、安装
ruby ~/brew_install

参考 :https://blog.csdn.net/qq_35624642/article/details/79682979

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容