1. 推薦中科大源
1.1 臨時更換中科大源
#替換brew.git:
cd "$(brew --repo)" && git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
#替換homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" && git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
#步驟三
brew update
1.2 永久更換中科大源:
用戶profile添加
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
1.3 然後source用戶profile生效。
2. 清華源是第二選擇
2.1 臨時更換清華源
#替換brew.git:
cd "$(brew --repo)" && git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
#替換homebrew-core.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
#步驟三
brew update
2.2 永久更換清華源:
用戶profile添加
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
2.3 然後source用戶profile生效。
3. 恢復默認源
cd "$(brew --repo)" &&
git remote set-url origin https://github.com/Homebrew/brew.git &&
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" && git remote set-url origin https://github.com/Homebrew/homebrew-core && brew update
阿里雲
的源不推薦
,各種缺貨。
比如連cmake
都沒有: