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"
相关推荐
zhensherlock8 天前
Protocol Launcher 系列:Pika 取色器的协议控制(上篇)
前端·javascript·macos·typescript·github·mac·view design
钱多多_qdd9 天前
mac上安装claude
ai·mac
I'm Jie11 天前
MacOS 国内镜像一键安装 Homebrew
git·macos·homebrew
zhensherlock12 天前
Protocol Launcher 系列:App Store 精准引流与应用推广
javascript·macos·ios·typescript·iphone·mac·ipad
jianghao202515 天前
realesrgan-gui跨平台使用指南:Win/Mac/Linux全支持
linux·windows·mac·跨平台软件·realesrgan-gui
电饭叔23 天前
利用ip地址帮助macbook系统连接带有wifi功能的epson电脑
电脑·mac·macbook·mac book添加打印机
雨洛lhw23 天前
基于 FPGA 的主机 IP 自动配置方案设计
udp·mac·ip·fpga·dhcp
pe7er1 个月前
macOS 应用无法打开(权限问题)解决方案
macos·mac
*.✧屠苏隐遥(ノ◕ヮ◕)ノ*.✧1 个月前
JSP, MVC, El, JSTL, MAC
java·开发语言·mvc·mac·jsp
独泪了无痕1 个月前
Mac Homebrew 安装 MySQL 指南
数据库·mysql·mac