Mac上brew切换国内源【极简方案】

前言

下载一些开源包如telnet时,通过brew下载经常由于网络不通,导致下载失败。所以mac用户最好一次性设置brew为国内源。

方案

极简四步,换Homebrew的镜像源为阿里云镜像,依次在终端执行以下几步:

1、cd “$(brew --repo)”

2、git remote set-url origin https://mirrors.aliyun.com/brew.git

3、cd “$(brew --repo)/Library/Taps/homebrew/homebrew-core”

4、git remote set-url origin https://mirrors.aliyun.com/homebrew-core.git

验证

如何验证自己设置成功了呢?执行 brew config,查看配置中的ORIGIN: https://mirrors.aliyun.com/brew.git,说明切换源成功。

总结

可以开心下载了。

你可能感兴趣的:(操作系统,macos,brew,telnet)