无法使用打印服务


19

抱歉,如果这个问题看起来很熟悉:我尝试了google搜索提出的解决方案,但这些解决方案要么无效,要么对我来说太技术性了。

几天前,我把杯子弄得一团糟,我不记得确切的方式和原因,但最终删除了一些杯子文件。

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

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

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

sudo service cups restart

Shell回复到:

cups stop/waiting

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

我尝试了帮助菜单中的疑难解答说明,并说“ CUPS打印假脱机程序似乎未在运行。要解决此问题,请从主菜单中选择“系统->管理->服务”,然后查找“杯子”服务”

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

我也尝试过:

sudo /etc/init.d/cups start

产生了

cupsd: Child exited with status 1

您是否尝试过恢复从回收站或备份中删除的文件?
年长者极客2015年

否,但是这些文件位于cups文件夹中,因此我认为这些文件已通过重新安装进行了重写。
frepie

在您重新安装之前,这将是合乎逻辑的第一种方法,因为您知道已删除它们。在重新安装之前,您是否尝试完全清洗杯子?
极客长老

1
syslog:Jan 17 12:15:33 Inspiron-1501 cupsd: Unable to open "/etc/cups/cupsd.conf": No such file or directory Jan 17 12:15:33 Inspiron-1501 kernel: [80564.409920] init: cups main process (18868) terminated with status 1 Jan 17 12:15:33 Inspiron-1501 kernel: [80564.409977] init: cups main process ended, respawning
frepie

1
/etc/cups/cupsd.conf尽管我安装了几次杯子,但没有文件夹
frepie 2015年

Answers:


18

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

sudo apt-get install cups

接下来弹跳服务:

sudo /etc/init.d/cups restart

最后,重新启动机器。

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


5

我找到了一个解决方案:在论坛上找到了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

然后就成功了。


+1感谢一百万用户提供默认的cupsd.conf!我替换了空白副本,并恢复了所有原始打印机设置。不知道cupsd.conf如何清除其内容!我想知道是最近的CUPS更新吗?
user31301
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.