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

就可以成功了:

相关推荐
小溪彼岸2 天前
macOS自带截图命令ScreenCapture
macos
TESmart碲视2 天前
Mac 真正多显示器支持:TESmart USB-C KVM(搭载 DisplayLink 技术)如何实现
macos·计算机外设·电脑
2501_915106322 天前
Xcode 上传 ipa 全流程详解 App Store 上架流程、uni-app 生成 ipa 文件上传与审核指南
android·macos·ios·小程序·uni-app·iphone·xcode
他们都不看好你,偏偏你最不争气3 天前
【iOS】AFNetworking
开发语言·macos·ios·objective-c
钟念3 天前
【打包app】uniapp打包ios端和安卓端app
macos·objective-c·cocoa
森之鸟3 天前
Mac电脑上如何打印出字体图标
前端·javascript·macos
m_136873 天前
Mac M 系列芯片 YOLOv8 部署教程(CPU/Metal 后端一键安装)
yolo·macos
搜狐技术产品小编20234 天前
CAEmitterLayer:iOS 中创建炫酷粒子效果的魔法工具
macos·ios·objective-c·cocoa
未来之窗软件服务4 天前
操作系统应用开发(七)mac苹果模拟器——东方仙盟练气期
macos·仙盟创梦ide·东方仙盟·系统模拟器
liliangcsdn4 天前
Mac本地docker安装Kibana+ElasticSearch
elasticsearch·macos·docker