CUPS - Common Unix Printing System

For more information, visit this page

The Common Unix Printing System, CUPS, aims to provide a portable printing solution for Unix based systems, based on the Internet Printing Protocol (IPP). CUPS provides System V and Berkeley command-line user interfaces, as well as command line and web-based configuration interface.

CUPS allows for easy integration of printing resources for both open source and proprietary operating systems in a homogeneous network.

The CUPS server (cupsd) should be run on the machine which is physically connected to your printing devices (in the case of a parallel, serial or USB printer), and should be the machine where you wish to spool jobs while they wait to be printed.

The CUPS client tools should, obviously, be installed on any Debian machines from which you wish to print to the remote printer(s).

installation

Debian already has CUPS packages available, so you can simply use apt to install them:

# apt-get install cupsys-client cupsys
                

This will install both the client and server portions of the CUPS system. This should be done on the machine which is to be the CUPS server.

lpinfo

SYNTAX:
lpinfo -v
                
# lpinfo -v
network socket
network http
network ipp
network lpd
direct parallel:/dev/lp0
serial serial:/dev/ttyS1?baud=115200
serial serial:/dev/ttyS2?baud=115200
network smb
                

The "lpinfo -v" command lists the supported and available devices on the system. The first word is the type of device; direct, file, network or serial.

The "direct" and "serial" devices are printers that are physically connected to the machine, while the rest are all available over the network.

lpadmin

The lpadmin command allows you to add, remove and configure printers.

You can also use the web based configuration tool, by connecting to the following URL from the local machine:

http://localhost:631/admin
                

Adding a printer:

lpadmin -p <printername> -E -v <device> -m <ppd>
                

Where "printername" is the name you wish to give your printer, "device" is the device as we discussed earlier, and "ppd" is the printer driver to use.

You can find a list of PPD drivers on the CUPS site.

Examples:

This adds a local printer, connected on the parallel port, and gives it the name "deskjet":

lpadmin -p deskjet -E -v parallel:/dev/lp0 -m deskjet.ppd
                

This adds a remote, network printer, on 192.168.1.22, and gives it the name "laserjet":

lpadmin -p laserjet -E -v socket://192.168.1.22 -m laserjet.ppd
                

Removing a printer:

lpadmin -x <printername>
                

You can simply remove a printer by specifying the "-x" switch.

Example:

This removes our previously defined "laserjet" printer:

lpadmin -x laserjet