Mac下brew换源和终止
1. 换源
Homebrew更改为教育源:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
brew update
重置为官方地址:
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
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://github.com/Homebrew/homebrew-cask
brew update
替换Bottle源:
bash用户(shell用户):
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
zsh用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
2. 终止
rm -rf /usr/local/var/homebrew/locks
解决错误类型:Error: Another active Homebrew update process is already in progress. Please wait for it to finish or terminate it to continue.
3. 参考
- Homebrew 源使用帮助 — USTC Mirror Help 文档
- Homebrew Cask 源使用帮助 — USTC Mirror Help 文档
- Homebrew Core 源使用帮助 — USTC Mirror Help 文档
- 解决brew报错:Another active Homebrew update process is already in progress - 林台山人 - 博客园
- 解决:Another active Homebrew update process is already in progress._KANEKI的博客-CSDN博客
- Mac的brew修改源 - it610.com