当Ubuntu系统缓存过多时,可以通过以下几种方法进行清理和优化:
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
journalctl --disk-usage
sudo journalctl --vacuum-time 1w
sudo journalctl --vacuum-size 500M
ls /.opera/cache
ls /.mozilla/firefox/*.default/cache
deborphan
:sudo apt-get install deborphan -y
sudo apt-get remove --purge $(deborphan)
uname -a
dpkg --list | grep linux
sudo apt-get remove linux-image-version-generic
其中 version
是要删除的内核版本号。sudo su
sync
echo 3 | sudo tee /proc/sys/vm/drop_caches
free -m
Ubuntu Cleaner:功能包括清除APT缓存、缩略图缓存、未使用的包、旧内核以及旧安装程序等。
sudo add-apt-repository ppa:gerardpuig/ppa
sudo apt update
sudo apt install ubuntu-cleaner
BleachBit:支持清理缓存、cookies、日志文件等,支持多种应用程序。
sudo apt-get install bleachbit
Sweeper:移除与网络相关的cookies、历史记录、缓存等痕迹,清理图形缩略图缓存、应用和文件的历史记录。
sudo apt-get install sweeper
Stacer:系统优化、实时监控。
sudo add-apt-repository ppa:oguzhaninan/stacer
sudo apt update
sudo apt install stacer
通过上述方法,可以有效地清理和优化Ubuntu系统的缓存,提升系统的整体性能。在执行这些操作之前,建议备份重要数据,以防万一。