HomeBrew 切换源
home brew 的构成
名称 | 说明 |
---|---|
brew | 源代码仓库 |
homeBrew-core | 核心库 |
homebrew-cask | 大型二进制文件 |
homebrew-bottles | 预编译二进制软件包 |
此处采用科大镜像
1. 更新远程仓库(切换源)
git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
brew update
完事之后进到目录看一下,源都被改了
2. 更换镜像
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/bottles' >> ~/.zshrc
source ~/.zshrc
.zshrc
要根据自己情况来,也就是改一下自己的环境变量. 要是想看自己用的什么终端,可以这样
echo $0
如果是 bash 配置文件则为~/.bash_profile
是 zsh,则配置文件为~/.zshrc
3. 测试
brew install awscli
awscli 2.2.17 is already installed but outdated (so it will be upgraded).
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/gdbm-1.23.monterey.bottle.tar.gz
随便装个啥,看到已经从 ustc下载了