Mac 安装 HomeBrew

HomeBrew 官网安装

安装命令

bash 复制代码
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

卸载命令

bash 复制代码
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

清华大学镜像加速安装

清华大学 Homebrew 镜像文档地址

https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

配置镜像环境变量

bash 复制代码
export HOMEBREW_INSTALL_FROM_API=1
export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"

下载安装脚本

bash 复制代码
git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git ~/brew-install

运行安装脚本

bash 复制代码
/bin/bash ~/brew-install/install.sh

安装之后还需要将镜像地址写入环境变量配置文件 ~/.zprofile, 以便后续升级 brew

sh 复制代码
eval "$(/usr/local/bin/brew shellenv)"

# Set PATH, MANPATH, etc., for Homebrew.
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
相关推荐
猫头虎2 天前
macOS 双开/多开微信WeChat完整教程(支持 4.X 及以上版本)
java·vscode·macos·微信·编辑器·mac·脚本
weixin_438732103 天前
ChromeDriver谷歌驱动下载
linux·chrome·selenium·自动化·mac·chrome devtools·chromedriver
1telescope7 天前
MacBook 安装 Oh My Zsh 完整教程
macos·mac
海棠AI实验室8 天前
第0章|栏目简介:把 Mac M2 Ultra 变成“家庭私有 AI 生产机房”
人工智能·mac·comfyui·rag
奔跑的呱呱牛8 天前
解决MacOS下Chrome嗯下F5不刷新页面的问题
chrome·macos·mac
软件小滔9 天前
我使用MAC WiFi Explorer Pro完成了一次家庭网络“大扫除”
网络·macos·智能路由器·mac·应用推荐·wifi explorer
软件小滔10 天前
沉浸式Mac写作利器 Ulysses 深度体验
macos·mac·ulysses·应用推荐
CareyWYR12 天前
我开发了一款工具箱类型APP:CreativeUtil
ios·app·mac
软件小滔12 天前
Mac 上看图?从需求出发的功能匹配
经验分享·macos·mac·应用推荐
软件小滔12 天前
MacOS 26.0 网速监控我试了十几款,从系统API到可视化实现
经验分享·macos·mac·应用推荐