Homebrew无法通过curl直接安装,请求超时解决方案.

04-10
评论
字数统计:856(字)
主要原因在于官方给的链接 https://raw.githubusercontent.com 很难直接访问到,国内需要用国内的办法。

方案一:修改hosts

查询 https://raw.githubusercontent.com 所在ip,修改本地hosts文件。

  • 找一个ip查询工具,查出https://raw.githubusercontent.com 真实ip

  • # mac or linux
    sudo vim /etc/hosts
    # windows
    C:\Windows\System32\drivers\etc
    # 加上一行
    185.199.108.133 raw.githubusercontent.com
  • # 测试安装
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

方案二:修改国内访问地址(推荐)

直接通过 /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" 安装,国内版本,有更好国内源选择,速度快。

根据提示安装即可


本文链接:https://blog.crazylei.com/art/8b3c1ba5
版权声明: 本博客所有文章除特别声明外,均采用CC BY 4.0 CN协议 许可协议。转载请注明出处!

评论

正在加载评论...

友情链接:互链8收录网
©2022 Crazylei Bolg沪ICP备20001821号