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"
相关推荐
伊成18 小时前
Mac中如何Chrome禁用更新[update chflags macos]
chrome·mac
fengyun289120 小时前
Mac电脑 虚拟机 VMware Fusion13
macos·mac·虚拟机
API开发10 天前
苹果芯片macOS安装版Homebrew(亲测) ,一键安装node、python、vscode等,比绿色软件还干净、无污染
vscode·python·docker·nodejs·openssl·brew·homebrew
2401_8885670011 天前
Mac电脑-媒体文件格式转换-Permute
macos·mac·媒体·格式转换
2501_9205525612 天前
Mac电脑-音视频剪辑编辑-Final Cut Pro X(fcpx)
macos·音视频·mac
Bar_artist12 天前
键盘觉醒:Raycast 把 Mac 变成「AI 指令战舰」
人工智能·mac·wwdc·raycast
2401_8885670013 天前
Mac电脑 窗口分屏管理 Magnet Pro
macos·mac·分屏
伊织code13 天前
macOS - 根据序列号查看机型、保障信息
macos·mac·macbook·查看·序列号·机型·对应
iChochy13 天前
[开源自荐]AI Chat 智能聊天工具,支持DeepSeek 、Gemini、Grok、OpenAI和自定义AI
app·openai·mac·deepseek
90后的晨仔13 天前
pod报错:uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameE
ios·mac