mac上用homebrew经常卡在更新homebrew本身上
使用以下命令更换国内阿里云上的homebrew镜像:
<code># 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc/<code>
Tips: 注意自己机器的环境可能不是 ~/.zshrc,比如:~/.bashrc
如果更换源之后还是很慢可以加上 --verbose 查看具体原因
閱讀更多 神星火 的文章