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

相关推荐
怎么没有名字注册了啊3 天前
macOS 基于 CSDN GitCode + Homebrew Tap 发布 Qt .app 二进制程序通用教程(homebrew 安装自己的软件)
策略模式·homebrew·formula·ruhy
特立独行的猫a9 天前
鸿蒙PC搭建Go开发环境与网络服务实战全记录
华为·golang·harmonyos·homebrew·鸿蒙pc
特立独行的猫a25 天前
鸿蒙PC的包管理工具 Homebrew 正式上线,Harmonybrew介绍及使用指南
华为·harmonyos·homebrew·鸿蒙pc·harmonybrew
SunkingYang1 个月前
鼠标双击打开PPT里插入的附件文件时,报错:Office已阻止访问以下嵌入对象,以便保护你的安全
powerpoint·报错·附件·office·打开·已阻止访问·嵌入对象
xifangge20252 个月前
【2026终极解法】彻底解决“由于找不到 msvcp140.dll,无法继续执行代码”报错(附微软运行库一键修复包)
windows·mysql·microsoft·报错·开发环境
I'm Jie3 个月前
MacOS 国内镜像一键安装 Homebrew
git·macos·homebrew
学易4 个月前
第十五节.别人的工作流,如何使用和调试(上)?(2类必现报错/缺失节点/缺失模型/思路/实操/通用调试步骤)
人工智能·ai作画·stable diffusion·报错·comfyui·缺失节点
SunkingYang5 个月前
QT编译报错:提示Qt::SkipEmptyParts在Qt命名空间中找不到成员
qt·报错·命名空间·编译报错·skipemptyparts·no member named·in namespace qt
SunkingYang5 个月前
QT编译报错:使用Lambda表达式作为槽函数,报错‘xxx‘ in capture list does not name a variable
qt·list·报错·lambda表达式·槽函数·in capture list·does not name