# 将中科院的brew镜像地址写入到shell环境变量的配置文件中,实现替换brew原地址的效果
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"' >> ~/.zprofile
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"' >> ~/.zprofile
# 将brew添加到环境变量
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
# 必须重新载入shell环境变量配置文件?
source .zprofile
# 执行brew官网给出的安装代码,如果安装成功,会出现success等字样
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 测试 brew更新命令?
brew update
================ 拓展学习?============
# 使用brew安装和卸载git
# 安装git
brew install git
# 卸载git
brew uninstall git
# 卸载brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
|