解决国内 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 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

 

3、运行脚本


/usr/bin/ruby brew_installblog

 

安装成功后,输入以下命令检查是否安装成功:homebrew

 

 

 

注,添加清华大学镜像源:资源

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

source ~/.bash_profile

相关文章
相关标签/搜索