最近使用 brew update 时, 发现 homebrew 更新缓慢; 于是进行更换为国内源;
晚上这种教程很多, 我选择的是中科大的源; 当然清华的源也是可以的, 这取决于你当前所处的地理位置, 这样有更通畅的网络链接;
- https://mirrors.ustc.edu.cn/help/brew.git.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.
具体可参考如下文章:
来源: http://www.bubuko.com/infodetail-3462929.html