停止 CUPS 打印服务指南 | AI生成和翻译

Home 2026.02

Question: Ubuntu 中的 cups.service/stop 是什么?

Answer:

cups.service/stop 指的是在 Ubuntu 上使用 systemd(控制 service 最常用的方式)停止 CUPS 打印服务的操作。

什么是 CUPS?

CUPS 全称是 Common UNIX Printing System。它是 Ubuntu(以及大多数 Linux 发行版和 macOS)上的标准打印系统。 它负责处理:

该 systemd service 的名称为 cups.service,它运行主要的 CUPS daemon (cupsd)。

cups.service/stop 是什么意思?

它意味着执行命令来立即停止 CUPS 服务。

实际的命令是:

sudo systemctl stop cups.service

(或者简写为:sudo systemctl stop cups

停止它会发生什么?

常用的相关命令

目的 命令 备注
立即停止 CUPS sudo systemctl stop cups 立即停止
启动 CUPS sudo systemctl start cups -
重启 CUPS sudo systemctl restart cups 故障排除时最常用
禁止开机自启 sudo systemctl disable cups 仍可被手动启动
允许开机自启 sudo systemctl enable cups -
检查状态 sudo systemctl status cups 显示运行/停止状态以及最近的 log
停止 + 禁止自启 sudo systemctl stop cups
sudo systemctl disable cups
服务器上的常用操作

关于现代 Ubuntu 版本 (22.04+ / 24.04+) 的注意事项: 有时 CUPS 是作为 snap 包提供的(特别是 cupscups-browsed)。在这种情况下,systemctl 可能不起作用,你需要使用:

sudo snap stop cups
sudo snap disable cups

可以通过以下命令检查你使用的是哪个版本:

systemctl status cups.service
# 或者
snap list | grep cups

References:


Back Donate