homebrew - 我们如何减少 homebrew-cask 和 homebrew-core 文件夹的大小?
问题描述
有没有办法减少 homebrew-cask 和 homebrew-core 文件夹的大小?它们分别为 230.7 MB 和 346.5 MB。
此外,brew cleanup
没有做很多,二进制文件仍然存在于 ~/Library/Caches/Homebrew/downloads 文件夹中,这是设计使然吗?
解决方案
是的,这是设计使然。
man brew
对此进行了详细描述:
cleanup [options] [formula|cask ...]
Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae. If arguments are specified, only
do this for the given formulae and casks. Removes all downloads more than 120 days old. This can be adjusted with HOMEBREW_CLEANUP_MAX_AGE_DAYS.
--prune
Remove all cache files older than specified days. If you want to remove everything, use --prune=all.
-n, --dry-run
Show what would be removed, but do not actually remove anything.
-s Scrub the cache, including downloads for even the latest versions. Note downloads for any installed formulae or casks will still not be deleted. If
you want to delete those too: rm -rf "$(brew --cache)"
--prune-prefix
Only prune the symlinks and directories from the prefix and remove no other files.
因此,您可以运行brew cleanup -s
以从缓存中删除更多内容或rm -rf $(brew --cache)
删除整个缓存。
另请参阅https://github.com/Homebrew/brew/issues/3784
这是预期的行为。如果要删除所有内容,请运行建议的 rm 命令。
感谢你的回答。保留已安装的公式下载文件有什么用?
万一出现问题,您必须重新安装。
推荐阅读
- python - Python:记住过程序列中的状态
- android - Kotlin 中具有 2 个以上构造函数的 init 块
- python - 从 PyCharm 连接到正在运行的 Spark-Session
- powershell - 用于服务器 2008 的 Powershell 脚本,用于获取 MSMQ 安全属性值
- java - Hibernate 6 自定义验证器消息如何从属性文件中显示?
- powershell - export-csv 是否有跳过重复条目?
- python - 带有 % 的 Flask URL 参数未正确处理
- javascript - 如何跟踪调用的方法
- html - 引导响应式图标和图像
- angular - ngrx - 确保所有 http 调用都已完成并存储在商店中