AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 575136
Accepted
frepie
frepie
Asked: 2015-01-19 09:43:56 +0800 CST2015-01-19 09:43:56 +0800 CST 2015-01-19 09:43:56 +0800 CST

打印服务不可用

  • 772

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

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

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

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

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

sudo service cups restart

外壳回复:

cups stop/waiting

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

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

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

我也试过:

sudo /etc/init.d/cups start

产生了

cupsd: Child exited with status 1
14.04
  • 2 2 个回答
  • 47428 Views

2 个回答

  • Voted
  1. gatorback
    2016-06-30T16:26:28+08:002016-06-30T16:26:28+08:00

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

    sudo apt-get install cups
    

    接下来反弹服务:

    sudo /etc/init.d/cups restart
    

    最后,重启机器。

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

    • 23
  2. Best Answer
    frepie
    2015-01-19T12:56:22+08:002015-01-19T12:56:22+08:00

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

    成功了。

    • 5

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve