Installing CUPS for Printer
So, I have an old Samsung ML-2525W laser printer laying around. Naturally, since I'm looking for more gadgets to be connected to my Raspberry Pi, it got the job. The first shock of the day is that there is no standard printing spool. It took some digging to come up with lpr, and lp. Both of these program are old. The new one, after much digging, is CUPS (Common Unix Printing System). That one threw me out for a loop, because Apple made it.
Anyway, having CUPS makes life tremendously easy. There is a gotcha with permission, though. Let's go through the process.
The first thing you do is to install CUPS:
sudo apt-get install cups
After some heavy duty downloading, everything is set up. The installation starts cups daemon server automatically. You can check it out by opening your web browser to localhost port 631
If all goes well, you will see the browser showing CUPS Administration page.
Everything is browser-based, so it's really easy. Just add a new printer and you're home free.
You need to login and enter your password. The browser interface allows you to administer the printer completely, including moving printing jobs, or even cancelling them. You don't want just anybody to be able to do so.
Did I say adding a new printer is easy? Well, there's a gotcha. You cannot add a new printer without proper permission. Didn't you just entered your password? Yes, you did. So, what's going on?
This instruction should be with all printer installation instruction, but some missed it. You need to add yourself to printing administration group. Do this:
sudo usermod -aG lpadmin username
where if you're the default user, that should be "pi".
Success! I see my printer name there. After selecting it, would you believe I still have to choose my printer from a long list of names? Anyway, set up your defaults here. I set my page size to "US Letter".
That's it! Do a test print and see if it works! Congratulations, you just added a new printer!