Guide Of Mac
- 第一步:下載安裝腳本
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