主要是資源訪問太慢造成的,替換默認源鏡像就行。
brew使用國內鏡像源
這里用中科大的,另外還有清華的可用
1
2
3
4
5
6
7
8
9
10
|
# 步驟一
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
#步驟三
brew update
|
注意這里需要等待一會,因為要更新資源。
更新完后使用brew update,brew install
速度變快很多了,不會卡在那半天沒動靜,替換鏡像完成。
復原
1
2
3
4
5
6
7
|
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
|