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"
相关推荐
用户0958267572793 天前
前端工程师第一次mac系统安装mysql实践手册
mac
linchare8 天前
mac下homebrew安装的多个php版本如何切换?
php·homebrew·mac切换php版本
2501_9275393014 天前
Final Cut Pro X fcpx音视频剪辑编辑(Mac中文)
macos·fcpx·mac·视频剪辑
Winter_Sun灬15 天前
MacOS安装brew失败,无法访问github,怎么处理
macos·github·brew
悄然林静22 天前
Mac终端执行`brew doctor`报`openssl@1.1`警告
mac·xcode·apple
M-finder25 天前
Mac菜单栏综合工具FancyTool更新啦
mac·swift
Yisitelz1 个月前
签名、杂凑、MAC、HMAC
mac·密码·数据完整性·密评
2501_927539301 个月前
PDF Reader 编辑阅读(Mac)
pdf·mac·pdf reader
夏小花花1 个月前
Mac m系列芯片向日葵打不开 解决方案
macos·mac
今天头发还在吗1 个月前
关于Homebrew:Mac快速安装Homebrew
macos·homebrew·包管理