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

就可以成功了:

相关推荐
他们都不看好你,偏偏你最不争气10 小时前
【iOS】Runtime - Part 2 && 消息发送:缓存、查找与转发
macos·ios·objective-c·cocoa
Deepzz10 小时前
macOS 上调教第三方鼠标的一些经验:从滚动顺滑到输入法自动切换
macos·swift·鼠标
whyfail13 小时前
Colima:把 Docker Desktop 从 Mac 上“瘦身”的那把刀
macos·docker·容器
他们都不看好你,偏偏你最不争气15 小时前
【iOS】Runtime - Part 1 && 对象与类的本质
macos·ios·objective-c·cocoa
Shacoray18 小时前
Mac 向 Windows 局域网传文件方案整理
windows·macos
mxpan1 天前
macOS 13+ 上使用 macFUSE + NTFS-3G 读写 NTFS 移动硬盘技术说明
macos·策略模式
秋雨梧桐叶落莳2 天前
iOS——QQ音乐仿写项目总结
学习·macos·ui·ios·mvc·objective-c·xcode
MXsoft6182 天前
**用自动化脚本给MAC误阻断留条后路:可审计、可回滚的准入控制方案**
运维·macos·自动化
iUNPo2 天前
WWDC26 技术解读:Apple Intelligence、Siri AI 与苹果生态的下一步
macos·ios·wwdc
小米渣的逆袭2 天前
macos上一个好用的PDF文字提取工具方案
macos·pdf