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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章