Mac install homebrew error curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation

When homebrew installation, generally directly enter commands directly in the terminal:

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


But this method when network problems such as the title of this error will be reported.
This time brew_install.rb download the file directly, then the console command to run the ruby brew_install.rb. Download this file:
link: https: //pan.baidu.com/s/1rVh8bY73NLc77cQYN_2HoQ Password: n3si

 

Here Insert Picture Description————————————————

Homebrew change source

  1. 1. 替换brew.git:

  2. $ cd "$(brew --repo)"

  3. 中科大:

  4. $ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

  5. 清华:

  6. $ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

  7. 2. 替换homebrew-core.git:

  8. $ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

  9. 中科大:

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

  11. 清华:

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

  13. 3. 替换homebrew-bottles:

  14. 中科大:

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

  16. $ source ~/.bash_profile

  17. 清华:

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

  19. $ source ~/.bash_profile

  20. 4. 应用:

  21. $ brew update

Published 172 original articles · won praise 45 · views 40000 +

Guess you like

Origin blog.csdn.net/fish_study_csdn/article/details/104179105