切換為清華鏡像
1.curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
會生成brew_install文件
2.修改brew_install文件
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".freeze
3.安裝brew_install
/usr/bin/ruby ./brew_install
4.不用等强岸,直接新開命令行
cd /usr/local/Homebrew/Library/Taps/homebrew
git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
5.切換為清華鏡像
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
6.brew update
終端會顯示Already up-to-date须喂。