解决Homebrew无法更新问题
在用homebrew下载octave时发现需要更新,且长时间停留在updating,看了看百度发现是一些科学原因,需要用国内的清华或者中科院的镜像代替(毕竟连不上更新的网站嘛)。
以USTC镜像为例.
以为只需要替换Homebrew
,homebrew-cask
,homebrew-core
三个源,因此开始照搬操作。
- 替换
Homebrew
源
$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
$(brew --repo)
是用来自动指向Homebrew的目录的.
- 替换
homebrew-core
源
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
- 替换
homebrew-cask
源
$ cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
然后退出终端,再次进入后输入brew updat