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

2020-04-16  本文已影响0人  总有bug害本宫

错误:

~ % 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
上一篇 下一篇

猜你喜欢

热点阅读