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"
相关推荐
pe7er3 天前
macOS 应用无法打开(权限问题)解决方案
macos·mac
*.✧屠苏隐遥(ノ◕ヮ◕)ノ*.✧9 天前
JSP, MVC, El, JSTL, MAC
java·开发语言·mvc·mac·jsp
独泪了无痕10 天前
Mac Homebrew 安装 MySQL 指南
数据库·mysql·mac
chrisleequeen15 天前
【无标题】
conda·mac·anaconda·环境变量·export·no found
张泽泽zzz18 天前
使用VPN后 Mac出现能联网但无法访问网页的问题 <已解决>
mac
蓝丶曦月23 天前
MacM系列芯片安装 最新版本Notepad--(平替Windows系统的Notepad++)详细教程
编辑器·notepad++·mac
oushaojun21 个月前
趣谈网络协议栈,以太网基础MAC和PHY(转)
mac·tcp·linux网络·phy
上天_去_做颗惺星 EVE_BLUE1 个月前
Docker高效使用指南:从基础到实战模板
开发语言·ubuntu·docker·容器·mac·虚拟环境
WarmSword1 个月前
mac上用cursor/vscode调试root权限进程
c++·ide·vscode·macos·mac
Laughtin1 个月前
macos命令行更换终端代理的方法
macos·bash·mac