Homebrew执行brew install出现错误(homebrew-bottles)

问题描述

在使用homebrew安装软件时,出现如下报错:

Downloading https://mirrors.aliyun.com/homebrew/homebrew-bottles/bottles-portable-ruby/portable ruby-3.4.5.arm64_big_sur.bottle.tar.gz

curl: (22) The requested URL returned error: 404

==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:20fa657858e44a4b39171d6e4111f8a9716eb62a78ebbd1491d94f90bb7b830a

curl: (6) Could not resolve host: pkg-containers.githubusercontent.com

Deepseek说是下载源出了问题,于是在网上找了换源的教程,结果还是不行,后来发现,这篇教程修改的配置文件是.zshrc,后面找了另一篇教程,修改的配置文件是.zprofile,遂成功。如下:

bash 复制代码
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"' >> ~/.zprofile
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"' >> ~/.zprofile
echo 'export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"' >> ~/.zprofile
echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"' >> ~/.zprofile

将上面这段粘贴到终端,回车。使用vim打开./zprofile,找到类似下图中的配置并注释掉。保存并退出,然后执行source ~/.zprofile

此时再执行brew install或者brew update这些命令,就不会再报错啦。

相关推荐
snows_l1 天前
如何在MacOS上卸载并且重新安装Homebrew
macos·homebrew·utils
最幸伏的人1 个月前
Mac电脑安装HomeBrew
macos·homebrew
岁忧1 个月前
macOS 安装 Homebrew
macos·homebrew
API开发2 个月前
苹果芯片macOS安装版Homebrew(亲测) ,一键安装node、python、vscode等,比绿色软件还干净、无污染
vscode·python·docker·nodejs·openssl·brew·homebrew
陈嘿萌2 个月前
probability tensor contains either `inf`, `nan` or element < 0
报错·模型下载·安装qwen大模型·校验错误
秋意零3 个月前
【排坑指南】MySQL初始化后,Nacos与微服务无法连接??
运维·数据库·mysql·微服务·nacos·报错
gadiaola4 个月前
【苍穹外卖】Day01—Mac前端环境搭建
前端·nginx·macos·homebrew
jtymyxmz4 个月前
mac m2 安装 hbase
macos·hbase·homebrew
程序员老周6664 个月前
mac下载homebrew 安装和使用git
git·mac·homebrew·ssh密匙·windows转mac·mac配brew环境变量