How do I get rid of a ghost printer in Gnome?

Solution 1:

It turns out that this printer isn't installed anywhere on my system. This is Gnome auto-discovering my Brother laser printer (the one that is installed as HL4570CDW). So it ends up that the same printer shows up twice on the list (but only once functionally.)

I discovered this because I noticed that my printer's administration web interface said that the printer was located in the "Basement Utility Room" which exactly matches what the Gnome programs were saying. I figured out how to change that setting. Once I updated the printer to say it was in the "Office (1st Floor)", the dialog immediatly changed to say so as well:

If I unplug my printer from the network and try to print from a Gnome application, the "ghost printer" no longer appears. If I plug the printer back in and try to print it re-appears on the list.

I went into the printer configuration and disabled network services one at a time until I found the one that was causing the printer to magically appear (although non-functional.) The culprit is IPP. If I disable IPP services on the printer (and reboot it), then I no longer get the ghost printer even when the printer is on and connected to the network.

When IPP is disabled, you can still install the printer as LPD or raw socket. However, IPP may be important for printing from other platforms such as Windows and Mac.

In the end it appears to be a bug that a printer discovered via IPP is non-functional.


To stop programs from showing auto-discovered printers in the print dialog, you need to reconfigure the avahi daemon service as detailed in this answer to How do I disable automatic remote printer installation?:

edit /etc/avahi/avahi-daemon.conf and in the [server] section, add enable-dbus=no then restart the avahi-daemon service: sudo service avahi-daemon restart

Once I configure avahi like this, I no longer see this ghost printer even when the printer is available with IPP.

Solution 2:

I had a similar problem:

printer list.png

The bottom printer is from an older installation. I edited the file:

$ sudo -H gedit /etc/cups/printers.conf

# Printer configuration file for CUPS v2.1.3
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING

<DefaultPrinter DCP-7065DN>
UUID urn:uuid:1a785efb-bce4-35dd-7e44-c4fd53bb429a
Info Brother DCP-7065DN
  (... SNIP ...)
</DefaultPrinter>

<Printer DCP7065DN>
UUID urn:uuid:46e866c1-3ab2-324b-65fd-30d2fee77f85
Info DCP7065DN
  (... SNIP ...)
</Printer>

So I deleted the second entry...

<Printer DCP7065DN>
UUID urn:uuid:46e866c1-3ab2-324b-65fd-30d2fee77f85
Info DCP7065DN
  (... SNIP ...)
</Printer>

... and saved the file.

A reboot is necessary for changes to take effect.


There is also a printer definition file in /etc/cups/ppd:

printer ppd.png

So I removed this file too:

$ ll /etc/cups/ppd

total 28
drwxr-xr-x 2 root lp  4096 Aug 10  2018 ./
drwxr-xr-x 5 root lp  4096 Nov 10 09:59 ../
-rw-r----- 1 root lp  8191 Aug 10  2018 DCP-7065DN.ppd
-rw-r----- 1 root lp 10537 Aug  7  2018 DCP7065DN.ppd

$cat /etc/cups/ppd/DCP7065DN.ppd

*PPD-Adobe: "4.3"
*%================================================
*%  Copyright Brother Industries,Ltd 2006-2008
*%  "Brother DCP7065DN for CUPS"
*%================================================
  (... SNIP ...)
*UIConstraints: *InputSlot MANUAL   *Duplex DuplexTumble
*UIConstraints: *InputSlot MANUAL   *Duplex DuplexNoTumble

$ sudo rm -f /etc/cups/ppd/DCP7065DN.ppd