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

就可以成功了:

相关推荐
Damon小智15 小时前
玩转CodeX:CodeX安装教程(Windows+Linux+MacOS)
linux·windows·macos·ai·ai编程·codex·gpt-5
小番茄夫斯基20 小时前
团队效率神器!Mac 下 Homebrew 从入门到精通
macos
空安小菜鸟1 天前
Mac 重启电脑导致代理失效
macos
sweethhheart3 天前
【typora激活使用】mac操作方式
前端·数据库·macos
库奇噜啦呼3 天前
【iOS】简单的四则运算
macos·ios·cocoa
HoJunjie4 天前
macOS sequoia 15.7.1 源码安装node14,并加入nvm管理教程
macos·node.js
心灵宝贝4 天前
Principal v6.15 中文汉化版安装教程|Mac .dmg 文件安装步骤详解
macos
你好龙卷风!!!4 天前
mac | Windows 本地部署 Seata1.7.0,Nacos 作为配置中心、注册中心,MySQL 存储信息
windows·mysql·macos
源文雨4 天前
MacOS 下 Warp ping 局域网设备报错 ping: sendto: No route to host 的解决方法
运维·网络协议·安全·macos·网络安全·ping
liulilittle4 天前
macOS 内核路由表操作:直接 API 编程指南
网络·c++·macos·策略模式·路由·route·通信