美文网首页程序员
解决brew update很慢

解决brew update很慢

作者: 沐之轻语 | 来源:发表于2020-09-01 16:52 被阅读0次

一般遇到这种问题,就跟墙有关啦,需要更换源 或者设置代理。

一.设置代理(百度未尝试)

brew用curl下载,所以给curl挂上socks5的代理即可。
在~/.curlrc文件中输入代理地址即可。

二.更换源(题主使用)

用清华的源就非常好,去清华镜像的官网看一下说明,
https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

$ cd /usr/local/Homebrew
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

$ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

$ brew update

还原:

$ cd "$(brew --repo)"
$ git remote set-url origin https://github.com/Homebrew/brew.git

$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://github.com/Homebrew/homebrew-core

$ brew update

"$(brew --repo)" 这里填/usr/local/Homebrew

如果有问题,请联系作者进行处理

相关文章

网友评论

    本文标题:解决brew update很慢

    本文链接:https://www.haomeiwen.com/subject/txivsktx.html