mac以及linux安装brew(homebrew)
中科大官方文档:https://mirrors.ustc.edu.cn/help/brew.git.html?eqid=ef11a7dc000d146d000000046475aa2a
-
设置环境变量
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git" export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git" export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles" export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"
-
安装 Homebrew
/bin/bash -c "$(curl -fsSL https://github.com/Homebrew/install/raw/HEAD/install.sh)"
-
创建或编辑
.zprofile
文件vi /Users/你的用户名/.zprofile
-
添加以下内容到
.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)" export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git" export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
-
使文件生效
source ~/.zprofile
评论区