|
Homebrew安装无反应的解决方法
如果通过官方命令安装卡住,通常是因为网络问题(尤其是国内访问GitHub不稳定)。尝试以下两种方案:
方案一:使用国内镜像源安装
- /bin/zsh -c "$(curl -fsSL [url=https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"]https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"[/url]
复制代码
→ 按提示选择镜像源(推荐1中科大或2清华源)
方案二:手动预配置环境
- 先运行确保Xcode工具已安装:
- 添加环境变量到~/.zshrc文件末尾:
- export HOMEBREW_API_DOMAIN="[url=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"]https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"[/url]
- export HOMEBREW_BREW_GIT_REMOTE="[url=https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"]https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"[/url]
- export HOMEBREW_CORE_GIT_REMOTE="[url=https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"]https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"[/url]
复制代码
- 最后执行官方安装命令
提示:如果依然卡住,尝试开启VPN或使用手机热点
以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。 |
|