8

I am running Ubuntu 14.10 and when I open up the Printers dialog, I get an error message "Printing service not available. Start the service on this computer or connect to another server".

The start service button is greyed out.

I have tried

$ sudo service cups start
start: Job is already running: cups

Followed by

ps -ef|grep cups | grep -v grep
root      1210     1  0 08:15 ?        00:00:03 /usr/sbin/cups-browsed

I've tried to find some information in the logs about this, but the logs haven't been touched for days (and they are zero bytes)

ls -t -l
total 96
-rw-r----- 1 root lpadmin    0 Jan  3 08:45 access_log
-rw-r----- 1 root lpadmin    0 Jan  3 08:45 page_log
-rw-r----- 1 root lpadmin 7920 Jan  2 13:22 access_log.1
-rw-r----- 1 root lpadmin 3389 Jan  2 13:17 page_log.1
-rw-r----- 1 root lpadmin  125 Dec 31 09:20 access_log.2.gz
-rw-r----- 1 root lpadmin    0 Dec 31 08:29 error_log
...

Only other clue I've found is the following repeated many times in dmesg

[17169.471390] audit: type=1400 audit(1421413284.183:1700): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/cups/backend/cups-pdf" pid=26540 comm="apparmor_parser"
[17169.471398] audit: type=1400 audit(1421413284.183:1701): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=26540 comm="apparmor_parser"
[17169.492953] audit: type=1400 audit(1421413284.207:1702): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="third_party" pid=26540 comm="apparmor_parser"
[17169.496523] init: cups main process (26541) terminated with status 1
[17169.496532] init: cups main process ended, respawning

I've tried

sudo apt-get purge cups
sudo apt-get install cups --install-suggests

but still no change.

I've filed a bug about this at https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1407958 but is there anything obvious I've missed/should have checked?

ec2011
  • 405
  • 1
    try again and check logs in: tail /var/log/syslog – Benjamin Jan 16 '15 at 13:56
  • That "ps" is wrong. I would have expected also to see a /usr/sbin/cupsd – Rinzwind Jan 16 '15 at 14:36
  • @Benjamin, I think I see the problem. In /var/log/syslog, I see the error

    cupsd: Unable to open "/etc/cups/cupsd.conf": No such file or directory

    How can I force this file to get recreated?

    – ec2011 Jan 19 '15 at 10:04

5 Answers5

14

After a bit of searching and playing around, thanks to @Benjamin's comment above, I finally found that there is a default configuration file which should be installed in /usr/share/cups/cupsd.conf.default.

I ran

sudo cp /usr/share/cups/cupsd.conf.default /etc/cups/cupsd.conf
sudo service cups restart

and since then it worked!

I still have no idea how the file got lost in the first place though.

ec2011
  • 405
1

I ran:

sudo apt-get purge cups
sudo apt-get install cups --install-suggests

and then I checked that the configuration was correct. I still got a cups error trying to access a network HP printer, and I had to reinstall the printer, and then I got it to work.

  • That has pretty much the same effect as restoring the default configuration and restarting the CUPS service like in the accepted answer – but it's far more laborious. – David Foerster Nov 15 '16 at 13:49
  • To respond the the prior comment, the hplip needed to be removed and reinstalled using sudo apt-get purge hplp, then sudo apt-get hplip. – Python Jim Dec 05 '16 at 04:06
  • Why? Why was it not enough to reset the configuration and restart the service? The commands in your answer achieve no other outcome than that. – David Foerster Dec 05 '16 at 09:25
  • 1
    The problem was when cups got corrupted it had corrupted my hplip service as well, and restoring cups did not restore the hplip service, that is why the second install was required. – Python Jim Dec 12 '16 at 04:21
  • This installed a lot of packages in my PC which were never needed. – Deepam Gupta Jun 15 '21 at 15:30
0

What worked for me

sudo apt-get install --reinstall cups cups-browsed cups-client cups-common cups-daemon cups-server-common
0

My situation may have been different, as it was a little odd. I set up a new computer networked wirelessly to the system with a Brother HL3150CDN attached. Both systems running PopOS 20.10. The odd thing is that although the printer had been working fine from the new system after I'd added it, it suddenly vanished, a week or two later. (I'd had a few LAN dropouts, so that may have triggered it.) But when trying to add the printer back (via the system printer config tool), with the network address ipp://<$OLDCOMPUTER>:631/printers/lp, there was no suitable Brother driver for the model. I did have a .deb though for the printer on the old computer, so I installed that, like so:

# dpkg -i ~luke/linux/downloads/hl3150cdncupswrapper-1.1.2-1a.i386.deb
Selecting previously unselected package hl3150cdncupswrapper:i386.
(Reading database ... 476445 files and directories currently installed.)
Preparing to unpack .../hl3150cdncupswrapper-1.1.2-1a.i386.deb ...
Unpacking hl3150cdncupswrapper:i386 (1.1.2-1) ...
Setting up hl3150cdncupswrapper:i386 (1.1.2-1) ...
ERROR : Brother LPD filter is not installed.
Restarting cups (via systemctl): cups.service.
lpadmin -p HL3150CDN -E -v usb:/dev/usb/lp0 -P /usr/share/cups/model/Brother/brother_hl3150cdn_printer_en.ppd
lpadmin: Printer drivers are deprecated and will stop working in a future version of CUPS.

And then HL-3150CDN model appeared in the list of available Brothers, and I was able to add the printer and it appeared that I could print to it, with no error messages. But that was incorrect, and quite spurious: print jobs simply vanished.

Checking the printer, it was on but said it was in Deep sleep mode. I had to unplug the power cord and plug it back in to wake it up. After that, the (old) printer settings reappeared. Choosing that printer, all worked well. (The printer setting was "implicitclass://Brother_HL_3150CDN_series/")

So I deleted the freshly-added printers that didn't actually print, and carried on.

Like I said - weird.

LukeJKendall
  • 201
  • 2
  • 7
-1

I had an issue with a canon pixma 6800 in Linux Mint Tricia 19.3. It would not add in going through the add printers in your start menu. You have to add it directly into CUPS going to localhost:631 in your web browser and add it in there. I did it that way and it now works perfectly. So happy because I no longer need to go to the windows machine to use the canon.