打印服务不可用

打印服务不可用

抱歉,这个问题看起来很熟悉:我尝试了谷歌搜索提出的解决方案,但它们要么不起作用,要么对我来说太技术化了。

几天前我弄乱了杯子,我不记得具体是怎么回事以及为什么,但我最终删除了一些杯子文件。

我已多次通过软件中心和使用终端卸载并重新安装了 cups,并且还重新安装了 cups-daemon,但没有任何变化。

现在,我的本地打印机无法工作。我收到消息“打印服务不可用。在此计算机上启动服务或连接到另一台服务器”。“启动服务”按钮呈“灰色”状态 在此处输入图片描述

我尝试通过终端重新启动服务

sudo service cups restart

shell 回复道:

cups stop/waiting

然后什么都没发生,好像 shell 正在“等待”某事发生。我必须按 ctrl-c 才能恢复提示。

我尝试了帮助菜单中的故障排除说明,它说“CUPS 打印后台处理程序似乎没有运行。要纠正此问题,请从主菜单中选择“系统->管理->服务”,然后查找“cups”服务”

我不知道 Ubuntu 14.04 lts 中的“系统->管理->服务”在哪里

我也尝试过:

sudo /etc/init.d/cups start

结果

cupsd: Child exited with status 1

答案1

我遇到了类似的问题(lubuntu 16.04),“打印服务不可用”。这种情况导致系统无法列出本地 USB 打印机供选择。这个问题已经解决安装 CUPS:

sudo apt-get install cups

接下来反弹服务:

sudo /etc/init.d/cups restart

最后,重新启动机器。

我不需要在我的 Ubuntu 16.04 实例上安装 CUPS。

答案2

我找到了一个解决方案:我在论坛上找到了 cupsd.conf 的原始内容。因此,我通过执行以下操作创建了一个新的 cupsd.conf 文件:

gksudo gedit /etc/cups/cupsd.conf

并复制以下 cupsd.conf 原始内容

#
#
# Sample configuration file for the CUPS scheduler. See "man cupsd.conf" for a
# complete description of this file.
#

# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn

# Deactivate CUPS' internal logrotating, as we provide a better one, especially
# LogLevel debug2 gets usable now
MaxLogSize 0

# Administrator user group...
SystemGroup lpadmin

# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing Off
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS dnssd
BrowseAddress @LOCAL

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Restrict access to the server...
<Location />
  Order allow,deny
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</Location>

# Set the default printer/job policies...
<Policy default>
  # Job-related operations must be done by the owner or an administrator...
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

# Set the authenticated printer/job policies...
<Policy authenticated>
  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI>
    AuthType Default
    Order deny,allow
  </Limit>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

#
#

我保存了它然后重新启动了服务

sudo service cups restart

这招很管用。

相关内容