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

 

你可能感兴趣的:(mac)