homebrew 切换国内镜像源
时间: 2023-11-08 09:06:43 浏览: 167
要在 Homebrew 中切换国内镜像源,可以执行以下命令:
1. 首先备份 Homebrew 默认源文件:
```
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
```
2. 替换为国内源:
```
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
```
或者
```
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
```
3. 更新 Homebrew:
```
brew update
```
4. 替换 Homebrew Core 源:
```
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
```
或者
```
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
```
5. 更新 Homebrew Core:
```
brew update
相关问题:
阅读全文