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

相关推荐
我重来不说话9 天前
ai模型输入<think>xx返回错误
ai·报错·ai截断
tobebetter952715 天前
How to use homebrew on mac
macos·homebrew
liwulin050620 天前
【ESP32-S3-CAM】加载FLASH分区报错
报错·加载·魔数·esp32-s3-cam·flash内存
邪恶紫色秋裤2 个月前
解决IntelliJ IDEA控制台输出中文乱码问题
java·ide·乱码·intellij-idea·报错·中文
wangxiaosu2 个月前
macos安装、更新、使用homebrew
macos·homebrew
linchare3 个月前
mac下homebrew安装的多个php版本如何切换?
php·homebrew·mac切换php版本
虚伪的空想家3 个月前
K8S部署的ELK分片问题解决,报错:unexpected error while indexing monitoring document
运维·elk·云原生·容器·kubernetes·报错·eck
今天头发还在吗3 个月前
关于Homebrew:Mac快速安装Homebrew
macos·homebrew·包管理
snows_l3 个月前
如何在MacOS上卸载并且重新安装Homebrew
macos·homebrew·utils