macos使用brew报错解决办法

brew install wget

==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles-portable-ruby/portable-ruby-3.3.8.arm64_big_sur.bottle.tar.gz

Already downloaded: /Users/song/Library/Caches/Homebrew/portable-ruby-3.3.8.arm64_big_sur.bottle.tar.gz

Error: Checksum mismatch.

Expected: 7645e2d653a335798030f6502e7834dfdbeeec5629429a1a34da5dbb2c57d63e

Actual: f568e9c295c94cad3a65bdb7c106fd6b97689b2aae0bb34a2619e5b7d08e59f2

Archive: /Users/song/Library/Caches/Homebrew/portable-ruby-3.3.8.arm64_big_sur.bottle.tar.gz

To retry an incomplete download, remove the file above.

Error: Failed to upgrade Homebrew Portable Ruby!

这个报错是 Homebrew 在安装依赖(portable-ruby)时校验和不一致 导致的,常见于镜像源下载的文件损坏或者缓存文件过期。解决办法很简单:


✅ 解决步骤

  1. 删除损坏的缓存文件

    rm -f /Users/song/Library/Caches/Homebrew/portable-ruby-3.3.8.arm64_big_sur.bottle.tar.gz

  2. 更新 Homebrew

    brew update --force --quiet
    brew upgrade

  3. 重新安装 wget

    brew install wget


🔄 如果你一直遇到校验错误(因为用的是 USTC 镜像)

可以先切换回官方源再试:

复制代码
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
brew update

然后再执行:

复制代码
brew install wget

就可以成功了:

相关推荐
javaGHui9 小时前
macOS 上获取调试版
macos
2501_9159184113 小时前
iOS描述文件功能解析
android·macos·ios·小程序·uni-app·cocoa·iphone
2501_915918412 天前
iOS 上架应用市场全流程指南,App Store 审核机制、证书管理与跨平台免 Mac 上传发布方案(含开心上架实战)
android·macos·ios·小程序·uni-app·cocoa·iphone
darkb1rd2 天前
MacCalendar:专为 Mac 用户打造的高效日历工具
macos
神秘剑客_CN2 天前
MacOS学习笔记
笔记·学习·macos
数据饕餮3 天前
faster-whisper热词详解与程序设计
ide·macos·xcode
javaGHui3 天前
mac 安装 jdk17
macos·jdk
___波子 Pro Max.3 天前
Mac电脑解决sudo密码问题方法
macos
2501_938963963 天前
Flutter 3.19 桌面应用开发:适配 Windows/macOS 端窗口大小与菜单栏自定义
windows·flutter·macos
可乐大数据3 天前
macOS 一键免密登录阿里云 ECS:SSH 密钥对认证完整指南
macos·阿里云·ssh