【原创】MacOS 配置 Homebrew 国内源

简介

环境信息

MacOS 10.15.6
homebrew 2.5.1

正文

1、设置 git remote

设置 homebrew core,下面命令将设置 homebrew core 的 REPO 地址为清华源

git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

设置 homebrew cask,下面命令将设置 homebrew core 的 REPO 地址为清华源

git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git

设置 homebrew cask-fonts,下面命令将设置 homebrew cask-fonts 的 REPO 地址为清华源

git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git

设置 homebrew cask-drivers,下面命令将设置 homebrew cask-drivers 的 REPO 地址为清华源

git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git

注:上面的命令不需要全部执行,请根据你的需要设置即可。比如,你只用到了 homebrew 的基本命令,并没有用到 brew cask 相关的功能。那么后面的三项设置均可以不用设置。

3、更新 brew

brew update

总结

1、执行如下命令进行校验

git -C "$(brew --repo homebrew/core)" remote get-url origin
jiangzhuolin@bogon ~ % git -C "$(brew --repo homebrew/core)" remote get-url origin
https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

其他几项也是类似的方法,略过。

附录

列举附录及参考信息

https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值