Tricks for Installing a Laser Printer on Linux in CUPS(Wherein I rant about how bad CUPS has become.)
I had to set up two new printers recently. CUPS hasn't gotten any better since the last time I bought a printer, maybe five years ago; in fact, it's gotten quite a bit worse. I'm amazed at how difficult it was to add these fairly standard laser printers, both of which I'd researched beforehand to make sure they worked with Linux.
It took me about three hours for the first printer. The second one, a few weeks later, "only" took about 45 minutes ... at which point I realized I'd better write everything down so it'll be faster if I need to do it again, or if I get the silly notion that I might want to print from another computer, like my laptop.
I used the CUPS web interface; I didn't try any of the command-line tools.
Figure out the connection type
In the CUPS web interface, after you log in and click on Administration, whether you click on Find New Printers or Add Printer, you're faced with a bunch of identical options with no clue how to choose between them. For example, Find New Printers with a Dell E310dw connected shows:
- [Add This Printer] Virtual Braille BRF Printer (CUPS-BRF)
- [Add This Printer] Dell Printer E310dw (Dell Printer E310dw)
- [Add This Printer] Dell Printer E310dw (Dell Printer E310dw)
- [Add This Printer] Dell Printer E310dw (Dell Printer E310dw (driverless))
What is a normal human supposed to do with this? What's the difference between the three E210dw entries and which one am I supposed to choose? (Skipping ahead: None of them.) And why is it finding a virtual Braille BRF Printer?
The only way to find out the difference is to choose one, click on Next and look carefully at the URL. For the three E310dw options above, that gives:
- dnssd://Dell%20Printer%20E310dw._ipp._tcp.local/?uuid=[long uuid here]
Again skipping ahead: none of those are actually right. Go ahead, try all three of them and see. You'll get error messages about empty PPD files. But while you're trying them, write down, for each one, the URL listed as Connection (something like the dnssd:, lpd: or ipp: URLs listed above); and note, in the driver list after you click on your manufacturer, how many entries there are for your printer model, and where they show up in the list. You'll need that information later.
Download some drivers
Muttering about the idiocy of all this -- why ship empty drivers that won't install? Why not just omit drivers if they're not available? Why use the exact same name for three different printer entries and four different driver entries? -- the next step is to download and install the manufacturer's drivers. If you're on anything but Redhat, you'll probably either need to download an RPM and unpack it, or else google for the hidden .deb files that exist on both Dell's and Brother's websites that their sites won't actually find for you.
It might seem like you could just grab the PPD from inside those RPM files and put it wherever CUPS is finding empty ones, but I never got that to work. Much as I dislike installing proprietary .deb files, for both printers that was the only method I found that worked. Both Dell and Brother have two different packages to install. Why two and what's the difference? I don't know.
Once you've installed the printer driver packages, you can go back
to the CUPS Add Printer screen. Which hasn't gotten any clearer
than before. But for both the Brother and the Dell, ipp: is the only
printer protocol that worked. So try each entry until you find
the one that starts with
Set up an IP address and the correct URL
But wait, you're not done. Because CUPS gives you a URL like
ipp://DELL316BAA.local:631/ipp/print, and whatever that
.local thing is, it doesn't work. You'll be able to install the
printer, but when you try to print to it it fails with
"unable to locate printer".
(.local apparently has something to do with assuming you're running a daemon that does "Bonjour", the latest name for the Apple service discovery protocol that was originally called Rendezvous, then renamed to Zeroconf, then to Bonjour. On Linux it's called Avahi, but even with an Avahi daemon this .local thing didn't work for me. At least it made me realize that I had the useless Avahi daemon running, so now I can remove it.).
So go back to Add Printer and click on Internet Printing Protocol (ipp) under Other network printers and click Continue. That takes you to a screen that suggests that you want URLs like:
None of these is actually right. What these printers want --
at least, what both the Brother and the Dell wanted -- was
printerhostname? Oh, did I forget to mention static IP? I definitely recommend that you make a static IP for your printer, or at least add it to your router's DHCP list so it always gets the same address. Then you can make an entry in /etc/hosts for printerhostname. I guess that .local thing was supposed to compensate for an address that changes all the time, which might be a nifty idea if it worked, but since it doesn't, make a static IP and use it in your ipp: URL.
Choose a driver
Now, finally! you can move on to choosing a driver. After you pick the manufacturer, you'll be presented with a list that probably includes at least three entries for your printer model. Here's where it helps if you paid attention to how the list looked before you installed the manufacturer's drivers: if there's a new entry for your printer that wasn't there before, that's the non-empty one you want. If there are two or more new entries for your printer that weren't there before, as there were for the Dell ... shrug, all you can do is pick one and hope.
Of course, once you manage to get through configuration to "Printer successfully added", you should immediately run Maintenance->Print Test Page. You may have to power cycle the printer first since it has probably gone to sleep while you were fighting with CUPS.
All this took me maybe three hours the first time, but it only took me about 45 minutes the second time. Hopefully now that I've written this, it'll be much faster next time. At least if I don't succumb to the siren song of thinking a fairly standard laser printer ought to have a driver that's already in CUPS, like they did a decade ago, instead of always needing a download from the manufacturer.
If laser printers are this hard I don't even want to think about what it's like to install a photo printer on Linux these days.
[ 16:19 Jan 25, 2018 More linux | permalink to this entry | ]