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"
相关推荐
pe7er2 天前
Mac 修复「XXXXX已损坏,无法打开」完整方案
mac
rocket v3.5.65 天前
Beyond Compare 永久试用 Pro 功能教程(MacOS 版)
mac·beyond compare·无限试用
怎么没有名字注册了啊8 天前
macOS 基于 CSDN GitCode + Homebrew Tap 发布 Qt .app 二进制程序通用教程(homebrew 安装自己的软件)
策略模式·homebrew·formula·ruhy
Flywith248 天前
开源项目:把本地视频转成 Live Photo 并导入 Apple Photos
app·mac·apple
Irissgwe14 天前
9、数据链路层
linux·网络·mac·ip·数据链路层·arp协议·以太网帧格式
特立独行的猫a14 天前
鸿蒙PC搭建Go开发环境与网络服务实战全记录
华为·golang·harmonyos·homebrew·鸿蒙pc
嘿嘻哈呀14 天前
Mac 如何通过 SSH 控制同一 Wi-Fi 下的 Windows 电脑
windows·ssh·mac·局域网·openssh
起个破名想半天了15 天前
OpenClaw保姆级配置教程(适用于Mac)
mac·openclaw·配置教程
我要改名叫嘟嘟15 天前
我新买一台电脑,教育优惠配国补
mac