把官网给的脚本拿下来 git
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_installgithub
这里我替换成清华大学的镜像,修改以下两句: ruby
BREW_REPO = “https://github.com/Homebrew/brew“.freeze
CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core“.freeze curl
更改成这两句 url
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".freezehomebrew
也能够换成别家的。资源
/usr/bin/ruby brew_installit