Mac安裝homebrew報錯curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation

homebrew安裝時,一般直接在終端直接輸入命令:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


但是這個方法在網絡有問題時會報如題這個錯誤。
這個時候直接將文件brew_install.rb下載,然後控制檯運行ruby brew_install.rb命令即可。此文件下載地址:
鏈接:https://pan.baidu.com/s/1rVh8bY73NLc77cQYN_2HoQ 密碼:n3si

 

在這裏插入圖片描述————————————————

Homebrew換源

 

1. 替換brew.git:
$ cd "$(brew --repo)"
中科大:
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
清華:
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

2. 替換homebrew-core.git:
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

中科大:
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

清華:
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git


3. 替換homebrew-bottles:

中科大:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

清華:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile

$ source ~/.bash_profile

4. 應用:
$ brew update

 


原文鏈接:

https://blog.csdn.net/sinat_27741463/article/details/102950077

https://blog.csdn.net/d940319760/article/details/94446136

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章