Printing with CUPS, Part 1 - Page 4
Standalone Linux PC with Attached Printer
Run lpinfo to see a list of supported devices on your system:
OK, this is good – we can use any kind of physical printer connection. I have an old HP LaserJet 6L, the Unkillable Printer – this old thing just keeps on working. (Note: There is a free fix for some HP printers that develop paper feed problems, such as feeding too many pages; see here.)
This command installs the printer:
# /usr/sbin/lpadmin -p HPLaserJet -L powerpc -E -v parallel:/dev/lp0 -m laserjet.ppd
lpadmin -p sets the printer name. This can be anything (do not have duplicates, though).
-L sets the printer location. Again, this can be anything – make it something useful that tells where the printer is or what it is attached to.
-E enables the printer and makes it ready to receive jobs.
-v sets the deviceURI, which comes from lpinfo.
-m sets either an interface script or a PPD file, or it defines the "drivers."
Note that switches must be hyphenated individually; they cannot be combined.
While that was fun, installing printers via the CUPS browser-based interface, http://localhost:631/admin, tends to be a bit more enjoyable (although it is good to understand the lpadmin commands). The installation menus are self-explanatory. When you get to the menu for selecting the driver, I recommend choosing the Gimp-Print driver, if one is available.
An easy and interesting exercise is to install your local printer with different drivers (if more than one is available), then print and compare the test pages. (Be sure to delete each driver before installing a new one; don't try to install multiple drivers for the same printer.)
For PPD files obtained elsewhere, such as linuxprinting.org, see the handy-dandy PPD file tester – test 'em before trying to use 'em.
Notice how the CUPS Web interface stays synchronized with the command line. It might take a refresh or two, but it's possible to switch back and forth and not worry about conflicts.
In Part 2 we'll explore using CUPS with networked printers, including network-direct, and Windows servers and clients.