在 Ubuntu 上做“清理/瘦身”通常有系统自带工具和第三方工具两类,下面按常用程度给你梳理:
apt 清理sudo apt autoremove # 删除不再需要的依赖
sudo apt autoclean # 清理旧版本 deb 缓存
sudo apt clean # 清空所有 apt 缓存
df -h
du -sh /* | sort -h
sudo apt purge linux-image-旧版本
# 或
sudo apt autoremove --purge
sudo apt install bleachbit
⚠️ 注意不要勾选“系统危险项”
sudo apt install stacer
功能:
sudo apt install ncdu
ncdu /
非常适合找“谁占空间”
apt-get autoremove 后手动删 /usrapt autoremove + ncdu如果你愿意,可以告诉我:
我可以给你更精确的命令。