在 Debian 系统中,“刷新缓存”可能指几种不同场景,下面分别说明:
这是最常见的“刷新缓存”,用于更新可用软件包列表。
sudo apt update
如果你还想升级已安装的软件:
sudo apt upgrade
或一次性完成:
sudo apt update && sudo apt upgrade
APT 会缓存下载的 .deb 文件,可清理以释放空间。
清理不再需要的缓存:
sudo apt clean
只删除旧版本缓存(更温和):
sudo apt autoclean
Debian 默认通常没有系统级 DNS 缓存,除非你装了:
sudo systemd-resolve --flush-caches
# 新版本
sudo resolvectl flush-caches
sudo systemctl restart nscd
sudo systemctl restart dnsmasq
sudo depmod -a
fc-cache -fv
如果你说的“缓存”是某一特定场景(比如浏览器、Docker、桌面环境),可以告诉我具体是什么,我可以给更精确的方法。