Homebrew官方的源一般下载包之类的会很慢,所以通常我们都是用国内的镜像源来代替,这样会提高我们的效率。Homebrew主要有四个部分组成: brew、homebrew-core 、homebrew-bottles、homebrew-cask。
| 名称 | 说明 |
|---|---|
| brew | Homebrew 源代码仓库 |
| homebrew-core | Homebrew 核心软件仓库 |
| homebrew-bottles | Homebrew 预编译二进制软件包 |
| homebrew-cask | MacOS 客户端应用 |
Homebrew国内镜像源目前主要有中科大镜像、阿里镜像、清华镜像。
首先查看自己本地的镜像源地址是什么,在命令行输入以下命令可以查询:
查看 brew.git 当前源
cd "$(brew --repo)" && git remote -v
查看 homebrew-core.git 当前源
cd "$(brew --repo homebrew/core)" && git remote -v
如果输出是下面这些,就代表不是本地镜像源,可以换成本地镜像源,这样下载会更快点。
查看 brew.git 当前源输出
origin https://github.com/Homebrew/brew.git (fetch)
origin https://github.com/Homebrew/brew.git (push)
查看 homebrew-core.git 当前源输出
origin https://github.com/Homebrew/homebrew-core.git (fetch)
origin https://github.com/Homebrew/homebrew-core.git (push)
本文详细介绍了如何将MacOS上的Homebrew切换到中科大、阿里、清华等国内镜像源,以加快软件包的下载速度。包括brew、homebrew-core、homebrew-cask和homebrew-bottles的替换方法,并提供了切换回官方源的步骤。
最低0.47元/天 解锁文章
1783

被折叠的 条评论
为什么被折叠?



