把官网给的脚本拿下来 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 bash
更改成这两句 curl
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".freezeurl
也能够换成别家的。spa
/usr/bin/ruby brew_installblog
安装成功后,输入以下命令检查是否安装成功:homebrew
注,添加清华大学镜像源:资源
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles'>> ~/.bash_profile
source ~/.bash_profile