Homebrew切换为国内镜像源

本文详细介绍了如何将Homebrew的镜像源切换到国内的中科大和阿里云,包括切换、查看和重置操作。同时,提供了安装过程中可能遇到的问题及解决方案,如网络故障时手动下载和创建目录进行clone。此外,列出了一些常用Homebrew命令以供参考。
摘要由CSDN通过智能技术生成

1、brew.git 镜像

中科大镜像:https://mirrors.ustc.edu.cn/brew.git

阿里镜像:  https://mirrors.aliyun.com/homebrew/brew.git

清华镜像:https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

GitHub镜像:https://github.com/Homebrew/brew.git

2、homebrew-core.git 镜像

中科大镜像:https://mirrors.ustc.edu.cn/homebrew-core.git

阿里镜像:  https://mirrors.aliyun.com/homebrew/homebrew-core.git

清华镜像:https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

GitHub镜像:https://github.com/Homebrew/homebrew-core

3、homebrew-cask.git 镜像

# 中科大镜像
https://mirrors.ustc.edu.cn/homebrew-cask.git
# 阿里暂无该镜像

# github镜像
https://github.com/Homebrew/homebrew-cask.git

 

 

一、切换 Homebrew 镜像源为中科大镜像源

1、替换源

以中科大镜像为例

# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

# 替换homebrew-cask.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://mirrors.ustc.edu.cn/
  • 4
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值