Mac 使用brew 问题(很慢)

brew install or brew update 都很慢!

使用国内的镜像:

1、替换现有上游 
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
 

2、复原方法
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
 

感觉还是家代理比较快:

临时添加代理:

export ALL_PROXY=socks5://127.0.0.1:1081

永久添加代理:

echo export ALL_PROXY=socks5://127.0.0.1:1080 >> ~/.bash_profile

source ~/.base_profile

扫描二维码关注公众号,回复: 10344050 查看本文章
发布了29 篇原创文章 · 获赞 5 · 访问量 7973

猜你喜欢

转载自blog.csdn.net/qq_25194685/article/details/105224323