替换homebrew默认源为国内镜像源
方法一
$ cd /usr/local
$ git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew.git
$ brew update
如果速度还是很慢,可以尝试以下操作,然后重试update
$ cd ~/tmp
$ git clone git://mirrors.tuna.tsinghua.edu.cn/homebrew.git
$ rm -rf /usr/local/.git
$ rm -rf /usr/local/Library
$ cp -R homebrew/.git /usr/local/
$ cp -R homebrew/Library /usr/local/
使用homebrew-science
$ cd /usr/local/Library/Taps/homebrew/homebrew-science
$ git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew-science.git
$ brew update
或者homebrew-python
$ cd /usr/local/Library/Taps/homebrew/homebrew-python
$ git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew-python.git
$ brew update
方法二
$ cd /usr/local
$ git remote set-url origin git://mirrors.ustc.edu.cn/homebrew.git
国内开源镜像源:
清华镜像源: http://mirrors.tuna.tsinghua.edu.cn/
科大镜像源: http://mirrors.ustc.edu.cn/