定制Debian系统清理策略可从以下方面入手:
sudo apt-get clean
清理所有已下载软件包缓存,sudo apt-get autoclean
清理过期缓存,sudo apt-get autoremove --purge
删除不再需要的软件包及其配置文件。/tmp
和/var/tmp
目录文件,可用sudo rm -rf /tmp/*
等命令,也可通过systemd-tmpfiles
配置文件设置规则,还能用cron
定时任务定期清理。logrotate
工具管理,编辑/etc/logrotate.conf
或/etc/logrotate.d/
下配置文件,设置日志轮转、保留时间等参数,也可用sudo journalctl --vacuum-time
等命令清理。du
和find
命令查找大文件或特定文件删除,也可手动删除不用的软件、服务等。