解决国内 Mac 安装 brew 速度很慢问题

1、获取 install 文件

把官网给的脚本拿下来 git

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_installgithub

 

2、更改脚本中的资源连接

这里我替换成清华大学的镜像,修改以下两句: 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

 也能够换成别家的。资源

 

3、运行脚本


/usr/bin/ruby brew_installit