Homebrew Audit Skill
Quickly audit your Homebrew installation for outdated packages, cleanup opportunities, and health issues.
Usage
CODEBLOCK0
What It Checks
📦 Outdated Packages
Lists all formulae and casks with newer versions available, with current → available version info.
🧹 Cleanup Opportunities
Shows how many old versions/downloads can be removed and estimated disk savings. Run
brew cleanup to reclaim.
🩺 Health Check
Runs
brew doctor to detect:
- - Formulae with no source (orphaned kegs)
- Deprecated/disabled packages needing replacement
- Permission issues, broken symlinks, config problems
📊 Summary
Total formulae, casks, and Homebrew prefix.
When to Use
- - Periodic system maintenance (weekly/monthly)
- Before major upgrades
- When disk space is low
- After noticing build failures (doctor check)
Updating Packages
After reviewing the audit:
CODEBLOCK1
Homebrew 审计技能
快速审计您的 Homebrew 安装,检查过时的软件包、清理机会和健康问题。
使用方法
bash
完整审计(过时 + 清理 + 诊断 + 摘要)
bash scripts/brew-audit.sh
特定部分
bash scripts/brew-audit.sh --section outdated
bash scripts/brew-audit.sh --section cleanup
bash scripts/brew-audit.sh --section doctor
JSON 输出(仅限过时部分)
bash scripts/brew-audit.sh --json --section outdated
检查内容
📦 过时的软件包
列出所有有更新版本的公式和 casks,显示当前版本 → 可用版本信息。
🧹 清理机会
显示可删除的旧版本/下载数量以及预估的磁盘节省空间。运行 brew cleanup 进行回收。
🩺 健康检查
运行 brew doctor 检测:
- - 无来源的公式(孤立 keg)
- 需要替换的已弃用/禁用软件包
- 权限问题、损坏的符号链接、配置问题
📊 摘要
公式总数、casks 总数和 Homebrew 前缀。
使用时机
- - 定期系统维护(每周/每月)
- 重大升级前
- 磁盘空间不足时
- 注意到构建失败后(诊断检查)
更新软件包
审查审计结果后:
bash
brew upgrade # 升级所有过时软件包
brew upgrade
# 升级特定软件包
brew cleanup # 删除旧版本