在Ubuntu系统中回收磁盘空间可以通过多种方法实现,以下是一些常用的步骤和工具:
清理过时的软件包:
sudo apt autoclean
完全删除APT缓存:
sudo apt clean
删除不再需要的依赖包:
sudo apt autoremove
同时删除关联的配置文件:
sudo apt autoremove --purge
清理超过一定天数的旧日志:
sudo journalctl --vacuum-time=7d
查看已安装的内核版本:
dpkg --list | grep linux-image
删除不需要的旧内核版本:
sudo apt purge linux-image-x.x.x-x-generic
Firefox:
Chrome:
查找大文件:
sudo find / -type f -size +1G -exec ls -lh {} \;
BleachBit:
sudo apt-get install bleachbit
Ubuntu Cleaner:
sudo add-apt-repository ppa:gerardpuig/ppasudo apt updatesudo apt install ubuntu-cleaner
ncdu:
sudo apt-get install ncdu
sudo ncdu -x /
通过交互式界面查看和管理磁盘空间。Stacer:
sudo add-apt-repository ppa:oguzhaninan/stacer sudo apt update sudo apt install stacer
在执行删除操作前,请务必备份重要数据,以防意外发生。