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