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"
相关推荐
吞掉星星的鲸鱼7 天前
MAC M1 安装brew 配置环境变量,安装dart
macos·终端·dart·brew
苏佰侨。8 天前
docker minio启动命令
linux·运维·windows·macos·docker·容器·mac
tekin9 天前
macos pyenv 安装python tk 、tkinter图形库方法步骤和使用总结
macos·tkinter·brew·pyenv·tcl-tk·tk图形库安装
sysin.org9 天前
在不受支持的 Mac 上安装 macOS Sequoia (OpenCore Legacy Patcher v2.0.1)
macos·mac·macbook pro·sequoia
中草药z10 天前
【JavaEE】数据链路层协议和DNS
网络·学习·mac·ip·dns·mtu·数据链路
姚杰献11 天前
MacOS上安装MiniConda的详细步骤
人工智能·python·深度学习·macos·机器学习·conda·mac
秦伟杰11 天前
mac M1,M2,M3芯片踩坑 nodejs ruby brew
arm·nodejs·ruby·mac·nvm·m2·brew·m1·rvm·m3·苹果芯片
AUV110711 天前
Mac剪贴板历史全记录!
macos·swiftui·mac·效率工具·实用工具·剪贴板·clipboard
一笑11 天前
在MAC中Ollama开放其他电脑访问
mac·ollama·ollama api·ollama外网访问
AUV110711 天前
Mac 上哪个剪切板增强工具比较好用? 好用剪切板工具推荐
macos·swiftui·mac·剪贴板·clipboard·剪贴板增强·app 推荐