安装brew报错curl: (7) Failed to conn

2020-06-28  本文已影响0人  WeeverLu

参考: https://www.cnblogs.com/my-blogs-for-everone/articles/12843746.html

  1. 安装brew报错如下:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
  1. 修改/etc/hosts
$ sudo vi /etc/hosts

在最后一行添加199.232.68.133 raw.githubusercontent.com
esc->:wq保持退出后,再运行

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

还是报错

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

修改了git config --global http.postBuffer 524288000,改很大也没用

参考了《HomeBrew 官方安装太慢而失败?这么搞就行.(转载)》
https://www.jianshu.com/p/1911a9b3f506

  1. 获取install.sh
    我直接把https://raw.githubusercontent.com/Homebrew/install/master/install.sh下载到本地

  2. 更换清华源镜像

    BREW_REPO = "https://github.com/Homebrew/brew)"
    更改为
    BREW_REPO="https://mirrors.ustc.edu.cn/brew.git"

  3. 执行install.sh,输入密码,按Enter,就下载了

$ sh install.sh

其他参考上面的哈

可以试试阿里云Homebrew 镜像:https://developer.aliyun.com/mirror/homebrew

官网:https://brew.sh/index_zh-cn.html
git:https://github.com/Homebrew/brew

上一篇 下一篇

猜你喜欢

热点阅读