Guide Of Mac
-
国内网络安装HomeBrew
- 第一步:下载安装脚本
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
- 第二步:修改安装脚本中的url路径
将
BREW_REPO = “https://github.com/Homebrew/brew”.freeze
替换为
BREW_REPO = “https://mirrors.ustc.edu.cn/brew.git”.freeze # 当前镜像为中科大的,也可以使用其他镜像,如阿里云和清华
- 第三步:使用ruby安装
/usr/bin/ruby brew_install
- 第四步:替换homebrew-core源
cd “$(brew --repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
- 第五步:替换homebrew-cask源(未安装home-cask可以不需要,后续用到再添加)
cd “$(brew --repo)/Library/Taps/homebrew/homebrew-cask”
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
- 第六步:替换homebrew bottles源
echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles’ >> ~/.bash_profile
source ~/.bash_profile