macOS brew install XXX一直卡在Updating Homebrew…的解决办法

运行命令brew install mongodb,结果界面一直卡在Updating Homebrew…

解决办法是替换brew源:

--使用新源:

替换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.git:
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git

重置homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git

猜你喜欢

转载自www.cnblogs.com/paris-dream/p/9564384.html