一般咱們百度之後會用mac自帶的ruby去安裝homebrew,以下:git
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
而後發現downloading很慢基本就10kb/s
github
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
BREW_REPO = "https://github.com/Homebrew/brew".freeze
改成中國科大的源:ruby
BREW_REPO = "https://mirrors.ustc.edu.cn/brew.git".freeze
ruby brew_install
此時腳本會停在 :app
==> Tapping homebrew/core Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…
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 brew doctor