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"
相关推荐
HashFlag21 小时前
配置快捷命令登录远程服务机器
mac
鸿乃江边鸟21 小时前
Starrocks BE 在Mac编译以及遇到的问题解决
starrocks·mac·编译
带娃的IT创业者4 天前
MLX-VLM:在Mac上解锁视觉语言模型的本地推理与微调能力
人工智能·macos·语言模型·mac·视觉语言模型·mlx·本地推理
新刘海7 天前
MacBook网络已连接却上不了网
mac
特立独行的猫a9 天前
鸿蒙PC的包管理工具 Homebrew 正式上线,Harmonybrew介绍及使用指南
华为·harmonyos·homebrew·鸿蒙pc·harmonybrew
Mininglamp_271811 天前
开源端侧 AI Agent 全栈架构解析:Mano-P 模型 + Cider 推理加速 + AFK 自动构建
人工智能·架构·开源·agent·mac·apple silicon·gui agent
Naisu Xu13 天前
Mac上安装Homebrew、Git、Python等环境记录
git·python·macos·终端·brew
代码讲故事14 天前
mac电脑上docker突然无法运行,不停的出现弹框,“com.docker.vmnetd”将对你的电脑造成伤害。附国内不同芯片高速下载地址,下载直接运行。
macos·docker·容器·arm·mac·intel·下载
HashFlag23 天前
Codex配置Skill
windows·ai·mac·codex
William.csj24 天前
Mac/Zotero——切换翻译软件API的方法
mac·zotero