打印服务不可用

fre*_*pie 21 gnome printing cups-lpd 14.04

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

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

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

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

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

sudo service cups restart
Run Code Online (Sandbox Code Playgroud)

外壳回复:

cups stop/waiting
Run Code Online (Sandbox Code Playgroud)

然后什么也没有发生,就好像外壳在“等待”发生的事情。我必须执行 ctrl-c 才能恢复提示。

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

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

我也试过:

sudo /etc/init.d/cups start
Run Code Online (Sandbox Code Playgroud)

这产生了

cupsd: Child exited with status 1
Run Code Online (Sandbox Code Playgroud)

gat*_*ack 21

我有一个类似的问题(lubuntu 16.04)“打印服务不可用”。这种情况阻止系统列出本地 USB 打印机以供选择。这是克服安装 CUPS:

sudo apt-get install cups
Run Code Online (Sandbox Code Playgroud)

接下来反弹服务:

sudo /etc/init.d/cups restart
Run Code Online (Sandbox Code Playgroud)

最后,重启机器。

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


fre*_*pie 5

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

gksudo gedit /etc/cups/cupsd.conf
Run Code Online (Sandbox Code Playgroud)

并复制以下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>

#
#
Run Code Online (Sandbox Code Playgroud)

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

sudo service cups restart
Run Code Online (Sandbox Code Playgroud)

这样就成功了。