| 用途 | 清理包缓存与孤儿依赖释放磁盘 |
|---|---|
| 语法 | dnf clean / apt clean / autoremove |
| 所属 | dnf / APT |
常用示例
常用示例
du -sh /var/cache/dnf /var/cache/apt/archives 2>/dev/null
dnf clean all # 或 yum clean all
apt-get clean # 清包缓存(apt clean 同义)
apt-get autoremove --purge -y
dnf autoremove -y只清旧内核(RHEL)
只清旧内核(RHEL)
dnf remove --oldinstallonly --setopt installonly_limit=3 kernel # 慎用并核对autoremove 在 Debian 上会连带清配置(--purge 时);servers 上先 --dry-run 看清单。