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"
相关推荐
Wario1 天前
我在 Mac 上装了 Aerospace,效率翻倍不是说说而已
macos·mac
奕天者9 天前
计算机网络学习(八)——MAC
学习·计算机网络·mac
猫头虎11 天前
MacBookPro上macOS安装第三方应用报错解决方案:遇到:“无法打开“XXX”,因为无法确定(验证)开发者身份?怎么解决
macos·mac·策略模式·安全架构·mac安装软件·mac book·mac卸载软件
gadiaola13 天前
【苍穹外卖】Day01—Mac前端环境搭建
前端·nginx·macos·homebrew
猫头虎13 天前
MacBookPro上macOS安装第三方应用报错解决方案:遇到:“无法打开“XXX”,因为Apple无法检查其是否包含恶意软件 问题如何解决
macos·开源软件·mac·策略模式·远程工作·软件需求·安全架构
一如既往yes13 天前
Mac如何允许安装任何来源软件?
mac
拿回忆下酒15 天前
Electron+vite+vue3 从0到1搭建项目,开发Win、Mac客户端
windows·electron·mac·客户端·桌面客户端
羑悻的小杀马特16 天前
iOS:重新定义移动交互,引领智能生活新潮流
macos·ios·objective-c·cocoa·mac
私人珍藏库16 天前
[Mac] 开发环境部署工具ServBay 1.12.2
mac
闲人一小枚17 天前
mac 10.15.7 svn安装
svn·mac