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"
相关推荐
qwsaedca2 天前
在Mac上跑 Kokoro TTS经验总结
rust·mac·tts
2601_962381584 天前
Mac和Windows,哪种电脑适合新手学Python|数智码力分享
windows·python·mac·编程环境·学习入门
山野万澫里4 天前
新版macOS取消了启动台,老用户该如何适配?
macos·mac·启动台
bytebitx11 天前
MacOS 编译腾讯 Mars XLog 及使用(已16KB对齐)
kotlin·mac·apk
weixin_5316708913 天前
Interlude起来:动作动画和文字通知哪个更适合休息提醒?Mac上有没有用桌宠做动作引导的软件?
人工智能·macos·mac·swift
张星河zen15 天前
2nm工艺+AI算力跃升,深度拆解苹果Mac mini与Mac Studio主力芯片M6/M5 Ultra
mac·芯片·苹果·m6·m5
钱栈up22 天前
Mac 开发机一键发版不用切环境:我这样改造了团队的后端部署脚本
运维·python·mac
weixin_5316708923 天前
Interlude起来:Swift原生Mac软件有什么优势?原生Mac应用和Electron应用有什么区别?
人工智能·macos·mac·swift
霸刀25 天前
一次“Google 能打开,FlexTV 打不开”的 DNS 故障排查:从 curl 超时到完整证据链
mac·cdn·dns
wangruofeng25 天前
3 步把 MacBook 变成 7×24 远程主机,人在外面随时接管桌面
ios·agent·mac