查看brew的当前源
// 进入brew根目录,也可以用cd `brew --repo`
cd /usr/local/Homebrew
// 查看镜像源
git remote -v
更改brew镜像源
cd /usr/local/Homebrew
git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew.git
几个镜像:
https://github.com/Homebrew/brew.git -官方镜像源 https://git.coding.net/homebrew/homebrew.git - Coding https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git - 清华 https://mirrors.ustc.edu.cn/brew.git - 中科大
参考:
解决 “brew update” 无响应解决Homebrew下载更新极慢的问题Mac/Homebrew — brew update慢的解决方法
试了半天发现还是不行!!!
最后还是开启了全局代理,解决了速度慢的问题