在 Debian 系统里,“缓存”可能涉及多个层面,下面按常见场景给你说明怎么查看。
APT 下载的包默认放在:
/var/cache/apt/archives/
查看:
ls -lh /var/cache/apt/archives/
du -sh /var/cache/apt/
apt-cache policy
查看某个软件:
apt-cache policy nginx
apt-cache show nginx
# 删除已下载的 deb 包
sudo apt clean
# 删除旧版本缓存
sudo apt autoclean
free -h
或:
cat /proc/meminfo
关注:
BuffersCachedvmstat 1
systemd-resolve --statistics
或(新版):
resolvectl statistics
sudo nscd -g
ls -lh /var/cache/nginx/
ls -lh /var/cache/apache2/
如:
/var/cache/<服务名>/~/.cache/你可以告诉我:
我可以直接给你对应的查看和清理命令。