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这些命令,就不会再报错啦。

相关推荐
SunkingYang18 天前
QT编译报错:提示Qt::SkipEmptyParts在Qt命名空间中找不到成员
qt·报错·命名空间·编译报错·skipemptyparts·no member named·in namespace qt
SunkingYang18 天前
QT编译报错:使用Lambda表达式作为槽函数,报错‘xxx‘ in capture list does not name a variable
qt·list·报错·lambda表达式·槽函数·in capture list·does not name
深念Y20 天前
夸克网盘 应用程序无法启动,因为应用程序的并行配置不正确。有关详细信息,请参阅应用程序事件日志,或使用命令行sxstrace.exe 工具。
windows·bug·报错·系统·更新·网盘·夸克
小龙23 天前
【Git 报错解决】 远程仓库 origin 已存在(`remote origin already exists`)
git·报错
小龙24 天前
【Git 报错解决】本地无有效提交无法推送(`src refspec main does not match any`)
git·github·报错
he___H1 个月前
关于Amazon S3; Status Code: 403; Error Code: 403 Forbidden问题
java·报错·minio
ahauedu1 个月前
homebrew的源问题
mac·homebrew
我重来不说话2 个月前
ai模型输入<think>xx返回错误
ai·报错·ai截断
tobebetter95272 个月前
How to use homebrew on mac
macos·homebrew
liwulin05062 个月前
【ESP32-S3-CAM】加载FLASH分区报错
报错·加载·魔数·esp32-s3-cam·flash内存