美文网首页
Mac OS安装homebrew 443拒绝访问问题

Mac OS安装homebrew 443拒绝访问问题

作者: 总有bug害本宫 | 来源:发表于2020-04-16 17:24 被阅读0次

    错误:

    ~ % ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
    

    解决方法:(不用fq)
    1.下载homebrew.rb文件
    https://github.com/jackzhaoyu/ceshi

    2.terminal运行

    ruby homebrew.rb
    

    由于国外镜像不翻墙的安装的话基本就会被qiang,所以步骤2后可能发现以下问题,跳3

    error: RPC failed
    

    3.修改homebrew.rb文件

    BREW_REPO = "https://github.com/Homebrew/brew".freeze
    

    修改为(如果没有找到的CORE_TAP_REPO的话直接复制)

    BREW_REPO = "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
    

    完成以上修改后,运行

    ruby homebrew.rb
    

    如在3结束后遇到以下问题

    fatal: early EOF
    fatal: index-pack failed
    Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1` exited with 128.
    Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.
    Failed during: /usr/local/bin/brew update --force
    

    则依次执行以下代码

    git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
    cd "$(brew --repo)" 
    git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" 
    git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
    brew update
    

    相关文章

      网友评论

          本文标题:Mac OS安装homebrew 443拒绝访问问题

          本文链接:https://www.haomeiwen.com/subject/qdrdvhtx.html