在 Debian 系统中,“无用服务”通常指:
下面按 推荐程度 给你一套安全、规范的清理方案。
systemctl list-unit-files --type=service --state=enabled
systemctl list-units --type=service --state=running
sudo systemctl stop cups
sudo systemctl disable cups
常见可清理服务(按需):
| 服务名 | 说明 |
|---|---|
cups |
打印机服务 |
bluetooth |
蓝牙 |
avahi-daemon |
局域网发现 |
ModemManager |
调制解调器 |
nfs-server |
NFS 文件共享 |
smbd nmbd |
Samba |
apache2 / nginx |
Web 服务 |
postfix |
邮件服务 |
dpkg -S /lib/systemd/system/服务名.service
sudo apt purge 服务名
✅ 这是最干净的清理方式
sudo systemctl daemon-reload
sudo systemctl reset-failed
systemd-analyze blame
systemd-analyze critical-chain
千万别随便禁用:
systemd-journaldsystemd-logindnetworkingNetworkManagercronssh(如果你还要远程)sudo update-rc.d 服务名 remove
或
sudo rcconf
✅ 顺序:
list-unit-files 查看systemctl disablesystemctl stopapt purgedaemon-reload如果你愿意,可以:
systemctl list-unit-files --state=enabled 的输出贴出来我可以 帮你判断每一项是保留还是清理 ✅