Printers are devices straight from hell. Just stating a fact. Despite this unfortunate fact I can’t live without one. Digitization is woefully behind in the country I live in so there’s no way around occasionally having to scan and print stuff. Even if it’s just taxes once a year.
A short while ago I bought a new printer/scanner combo because the old one died on me. I spent quite some time researching a good choice and settled on a Brother device because those are, at least in my humble experience, easy to set up on the machines I have.
Everything was going fine until I realized that the printing functionality would not work on my work laptop which runs Fedora. Scanning was fine. I postponed this until recently when I finally sat down and tried to figure out what was wrong. Additionally, I started playing with openSUSE and tried to get my printer to work there as well.
Here is the gist of what I have learned. May it help future me and maybe one or two others as well. For the sake of this text I’ll assume a network printer that has access to the same network as the machine you want to control it with. If you have a cable connection, things might be easier and/or different.
Printing and scanning work completely independently from each other so let’s start with the easier part.
For scanning I use a GTK application called “Document Scanner”. It picks up a network scanner via the
SANE API automatically. In order for that to work you need to enable whatever backend your scanner
can be found with in the SANE config file located at /etc/sane.d/dll.conf
. There are a lot to
choose from, in my case I need one called escl
. This needs to be uncommented (or added) and then
the application will be able to pick up the scanner. Done.
Now for the hairier part. Printing on Linux uses CUPS. If you’re lucky, you don’t need to do anything, your printer might just be picked up automatically. If you run openSUSE (or something else) or Fedora has some quirk (which was the case for me), that won’t work. I tried adding the printer from the settings menu but no dice.
The next stop is the CUPS web interface that you can aaccess at localhost:631
. Open the admin page,
authenticate at root or a sudo user and choose to add a printer. My printer was recognized fine but
trying to add it plus a generic driver failed with an error message stating something like:
Could not poll sufficient capability info from the printer $PRINTER_NAME via ipp
After some digging I found out that discovering and/or communicating with a network printer works
via mDNS. If this is not enabled or misconfigured, your printer (you guessed it) won’t work.
On openSUSE this needs to be taken up with the local firewall. That’s all it takes. On Fedora
this should work out of the box. You can verify this by having a look at etc/nsswitch.conf
. It
should looke something like this:
# Generated by authselect
# Do not modify this file manually, use authselect instead. Any user changes will be overwritten.
# You can stop authselect from managing your configuration by calling 'authselect opt-out'.
# See authselect(8) for more details.
# In order of likelihood of use to accelerate lookup.
passwd: files systemd
shadow: files
group: files [SUCCESS=merge] systemd
hosts: files myhostname mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns
services: files
netgroup: files
automount: files
aliases: files
ethers: files
gshadow: files
networks: files dns
protocols: files
publickey: files
rpc: files
Note the reference to mdns4_minimal
. On fedora mDNS is handled by the nss-mdns
package
(see Fedora docs here). If it’s not
installed (which it should be out of the box), install it. If, for some reason, your nss-mdns
package
isn’t configured properly, a reinstallation may help. This is what I did and it regenerated the config
file to its initial state (I assume). After this, adding my network printer worked without issues.
I now have access to both scanning and printing functionality on my work laptop again which makes me very happy.
And the moral of the story: It’s always DNS.