Mac OS 下 HomeBrew 更新缓慢问题解决

#编程技术 2020-04-06 18:09:00 | 全文 202 字,阅读约需 1 分钟 | 加载中... 次浏览

👋 相关阅读


mac下的brew命令虽然非常好用,但是遇见更新慢时,是很闹心的一件事。

最简单的解决办法就是 替换国内源。

这里我们使用中科大的源(当然还有很多其它源,可自行搜索),方法如下:

替换brew.git

cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

替换homebrew-core.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

到此,搞定!

执行更新:

brew update

第一次可能会慢一点(大约5分钟),不过,后面执行brew install xxx软件时就会很快了。

附:

清华大学源: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

中科大源: https://mirrors.ustc.edu.cn/brew.git https://mirrors.ustc.edu.cn/homebrew-core.git

Edit | Last updated on 2024-04-21 11:10:27




×