homebrew install卡在Updating Homebrew
ben 2019-12-20
mac
homebrew
brew install xxx
长时间卡在这里:
Updating Homebrew...
# 解决方案
替换默认源
# 替换现有默认源
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
brew update
1
2
3
4
5
6
7
2
3
4
5
6
7
# 还原默认源
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
brew update
1
2
3
4
5
6
7
2
3
4
5
6
7
# 查看homebrew相关警告,可以看到相关默认源已替换完成
brew doctor