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

错误:

~ % 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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容