Homebrew 源更新;更换为国内源;

最近使用brew update时,发现homebrew更新缓慢;于是进行更换为国内源;

晚上这种教程很多,我选择的是中科大的源;当然清华的源也是可以的,这取决于你当前所处的地理位置,这样有更通畅的网络链接;

https://mirrors.ustc.edu.cn/help/brew.git.html

https://mirrors.ustc.edu.cn/help/homebrew-core.git.html

https://mirrors.ustc.edu.cn/help/homebrew-cask.git.html

https://mirrors.ustc.edu.cn/help/homebrew-bottles.html(可选)

临时配置bottles下载源:

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles # 如果需要持久化,可以配置在.bashrc之中;

上面链接中,教程比较完善;大家可以参考配置;

如果你发现,使用更新的源之后,还是有些文件下载得很慢的话,可以尝试使用其他工具进行下载,再放置到cache目录中即可;注意目录中的命令规则要符合原来的要求;

Homebrew stores downloaded files in either ~/Library/Caches/Homebrew or /Library/Caches/Homebrew (the former if it exists and the latter if the former doesn't). If you've already used Homebrew, check those locations and see which one exists, and drop the tar file you downloaded in that directory.

具体可参考如下文章:

https://stackoverflow.com/questions/23273637/how-to-find-where-homebrew-temporarily-saves-dependencies-being-downloaded

保持更新,转载请注明出处;更多内容请关注 cnblogs.com/xuyaowen;

posted @ 2020-03-15 16:59  "Michael_Xu"  阅读(3156)  评论(0编辑  收藏  举报