在 Debian 系统中,“缓存”可以指多种东西,例如:
/var/cache/apt/archives)下面按常见场景说明如何诊断 Debian 上的缓存问题。
du -sh /var/cache/apt/archives
ls -lh /var/cache/apt/archives/
sudo apt clean
sudo apt autoclean
sudo apt update
cat /var/log/apt/history.log
free -h
buff/cache 即为缓存cat /proc/meminfo
关注:
CachedBuffersDirtysudo sync
sudo echo 3 > /proc/sys/vm/drop_caches
systemd-resolve --statistics
或(新版本):
resolvectl statistics
清空 DNS 缓存:
sudo resolvectl flush-caches
sudo nscd -g
重启/清空:
sudo systemctl restart nscd
sudo systemctl status dnsmasq
grep proxy_cache /etc/nginx/nginx.conf
ls -lh /var/cache/nginx
redis-cli info memory
redis-cli flushall
varnishstat
varnishlog
✅ 检查 APT 缓存
✅ apt-cache policy 包名
✅ 清 DNS 缓存
✅ resolvectl flush-caches
✅ 看 buff/cache
✅ 属于正常 Linux 行为
✅ 清浏览器 / Nginx / CDN 缓存
journalctl -u 服务名htop / atopiotop(磁盘缓存写入)cachestat(需要 bcc / bpftrace)如果你能说明具体是哪一类缓存(APT / 内存 / DNS / Web / 其他)以及遇到了什么现象,我可以给你更精确的诊断命令和解决方案。