Differences between revisions 58 and 70 (spanning 12 versions)
Revision 58 as of 2020-02-24 16:07:54
Size: 54998
Editor: Brian Potkin
Comment: The web interface section: Selecting a driverless model for a networked printer or queue. Some touching up.
Revision 70 as of 2020-09-22 17:47:01
Size: 56631
Editor: Brian Potkin
Comment: Altered page description. Changes to intro, device URI. network URI, printer drivers, web interface, s-c-p. Altered links to avoid redirection. Added links.
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
Setting up and administering print queues within the CUPS printing system. Aimed at a Debian 10 (buster) installation, but much of the material should apply to Debian 9 (stretch) and Debian 8 (jessie) too. Setting up and administering print queues within the CUPS printing system. Aimed at a Debian 11 (bullseye) installation, but much of the material should apply to Debian 10 (buster), Debian 9 (stretch) and Debian 8 (jessie) too.
Line 16: Line 16:
The major changes in Debian 10 (buster) compared with the two previous stable distributions have to do with [[DriverlessPrinting|driverless printing]]. It is offered on Debian 9, but both CUPS and cups-browsed have augmented their software to include more filters and options to take advantage of modern-day printing technology. For CUPS it is worth mentioning the introduction of [[#tempq|temporary queue formation]] and [[DriverlessPrinting#rasters|Apple Raster]] as a supported PDL. For cups-browsed there is now a [[PrintingGlossaryandIndex#pclm|rastertopclm]] filter and more [[DebianMan:cups-browsed.conf|support]] for setting up driverless printing automatically.

Users of legacy printers (printers which depend on what the vendor software supplies) should be unaffected by these changes [[https://github.com/apple/cups/issues/5271|for now]].
The major changes in Debian 10 (buster) compared with the two previous stable distributions have to do with [[CUPSDriverlessPrinting|driverless printing]]. It is offered on Debian 9, but [[PrintingGlossaryandIndex#cups|CUPS]], [[PrintingGlossaryandIndex#cupsfilters|cups-filters]] and [[PrintingGlossaryandIndex#cupsbrowsed|cups-browsed]] have augmented their software to include more filters and options to take advantage of modern-day printing technology. For CUPS it is worth mentioning the introduction of [[#tempq|temporary queue formation]] and [[CUPSDriverlessPrinting#rasters|Apple Raster]] as a supported [[PrintingGlossaryandIndex#pdl|PDL]]. For cups-filters there is now a [[PrintingGlossaryandIndex#pclm|rastertopclm]] filter and cups-browsed has more [[DebianMan:cups-browsed.conf|support]] for setting up driverless printing automatically.

The single most important change in Debian 11 (bullseye) concerns the extension of driverless printing to include [[CUPSQuickPrintQueues#intro|modern printers]] that support [[CUPSDriverlessPrinting#ippoverusb|IPP-over-USB]]. Connecting a modern [[PrintingGlossaryandIndex#mfd|MFD]] to a USB port should see a [[#printqueue|print queue]] established [[CUPSDriverlessPrinting#debian|automatically]]. An alternative to auto-setup is to [[SystemPrinting#utilities|install a queue manually]]. The situation regarding whether all modern USB-only printer devices understand IPP-over-USB is unclear. However, many modern MFDs have been observed to interwork with this protocol
.

Users of legacy printers (printers that depend on what the [[SystemPrinting#intro|vendor software]] supplies) should be unaffected by these changes [[https://github.com/apple/cups/issues/5271|for now]].
Line 25: Line 27:
The properties specified when the [[#lpadmin|queue is created]] are not immutable. Quite a few of them can be altered by a user via DebianMan:lp or an application when the print job is submitted to the queue. A user can also set default printing options in [[DebianMan:lpoptions|~/.cups/lpoptions]]. An administrator who hoped to confine users to duplex (two-sided) printing, for example, would have to [[Tea4CUPS#nup1|look outside]] the CUPS framework for a solution to add to the system. The properties specified when the [[#lpadmin|queue is created]] are not immutable. Quite a few of them can be altered by a user via DebianMan:lp or an application when the print job is submitted to the queue. A user can also set default printing options in [[DebianMan:lpoptions|~/.cups/lpoptions]]. An administrator who hoped to confine users to duplex (two-sided) printing, for example, would have to [[CUPSTea4CUPS#nup1|look outside]] the CUPS framework for a solution to add to the system.
Line 34: Line 36:
Ultimately, a print job has to go somewhere; most users expect the job to go to a printer. However, the job is only going to get to the printer (after being taken out of the queue) if the [[PrintingGlossaryandIndex#deviceuri|device-uri]] is one recognised by CUPS and the printer. [[DebianMan:lpinfo|lpinfo]] allows you to see which device-uris are associated with a print server or printer: Ultimately, a [[#printqueue|print job]] has to go somewhere; most users expect the job to go to a printer. However, the job is only going to get to the printer or print queue (after being taken out of the CUPS queue) if the [[PrintingGlossaryandIndex#deviceuri|device-uri]] (or, for short, URI) is one recognised by CUPS and the printer or print queue. [[DebianMan:lpinfo|lpinfo]] allows you to see which device-uris and [[#backend|drivers (backends)]] are associated with a print server or a printer:
Line 40: Line 42:
[[DebianMan:backend|Backends]] in ''/usr/lib/cups/backends'' are now used in discovery mode in an endeavour to locate printers. Here is the output of one such command when two printers are attached to a Debian 10 (buster) machine via USB (an HP PSC 1300) and parallel (an Epson Stylus 740) ports and two are available over the network (an HP !LaserJet 2200 and an HP ENVY 4500): [[DebianMan:backend|Backends]] in ''/usr/lib/cups/backends'' are now used in discovery mode in an endeavour to locate printers. Here is the output of one such command when an legacy HP PSC 1300 is attached to a Debian 10 (buster) machine via USB and two printers are available over the network (a legacy HP !LaserJet 2200 and an [[CUPSQuickPrintQueues#intro|modern]] HP ENVY 4500). Execute `/usr/sbin/lpinfo -l -v` for more detail.

This output was produced from a machine with a buster installation. On a bulleye machine the final line would have a [[#ipp|different format]].
Line 50: Line 54:
direct parallel:/dev/lp0
serial serial:/dev/ttyS0?baud=115200
serial serial:/dev/ttyS1?baud=115200
Line 56: Line 57:
network dnssd://LaserJet-300%20%40%20desktop._ipp._tcp.local/cups?uuid=325fb239-90e7-3a46-7835-1e12939a1ba5
Line 57: Line 59:
network socket://192.168.7.211
Line 62: Line 63:
The USB connected printer and the networked ones have device-uris

{{{
direct usb://hp/psc%201300%20series?serial=HU3AFBQ28Y9F&interface=1
direct hp:/usb/psc_1300_series?serial=HU3AFBQ28Y9F

network dnssd://ENVY4500._ipp._tcp.local/?uuid=1c852a4d-b800-1f08-abcd-308d99fafac2
network socket://192.168.7.211
network socket://192.168.7.235:9100
network ipp://ENVY4500.local:631/ipp/print
}}}

 * The USB connected printer has been located by two backends; `usb` and `hp`. The first backend comes from CUPS and the second from [[#hplip|HPLIP]]. Either device-uri can be used.

 * The CUPS `snmp` backend has discovered the networked !LaserJet 2200 (at 192.168.7.211) and the ENVY 4500 (at 192.168.7.235). A queue set up with this device-uri for the !LaserJet would need the [[#lpadmin|-m option]] to be given a [[#ppd|PPD]]. The same would have to be done for the ENVY 4500 unless,
 alternatively, [[DriverlessPrinting|-m everywhere]] is used.

 * Additionally, the ENVY 4500 has been found from its [[PrintingGlossaryandIndex#dnssd|DNS-SD]] broadcasts by the CUPS `dnssd` backend and by [[#tempq|CUPS itself]]. Either device-uri can be used.

 *A parallel port has also been found by the cups-filters `parallel` backend. Its device-uri is

{{{
parallel:/dev/lp0
}}}

For more detail and to identify the makes and models of the printers you will want to do

{{{
lpinfo -l -v
}}}

In this case, an edited output is

{{{
Device: uri = usb://hp/psc%201300%20series?serial=HU3AFBQ28Y9F&interface=1
        class = direct
        info = hp psc 1300 series
        make-and-model = hp psc 1300 series
        device-id = MFG:hp;MDL:psc 1300 series;CMD:LDL,MLC,PML,DYN;
                    CLS:PRINTER;1284.4DL:4d,4e,1;SN:HU3AFBQ28Y9F;
                    S:0380008000020020112fff8d800fff8d800;Z:007;
        location =

Device: uri = hp:/usb/psc_1300_series?serial=HU3AFBQ28Y9F
        class = direct
        info = HP psc 1300 series USB HU3AFBQ28Y9F HPLIP
        make-and-model = HP psc 1300 series
        device-id = MFG:hp;MDL:psc 1300 series;CLS:PRINTER;
                    DES:psc 1300 series;SN:HU3AFBQ28Y9F;
        location =

Device: uri = parallel:/dev/lp0
        class = direct
        info = EPSON Stylus COLOR 740 LPT #1
        make-and-model = EPSON Stylus COLOR 740
        device-id = MFG:EPSON;CMD:ESCPL2,BDC,D4;MDL:Stylus COLOR 740;CLS:PRINTER;
        location =

Device: uri = socket://192.168.7.211
        class = network
        info = HP LaserJet 2200
        make-and-model = HP LaserJet 2200
        device-id = G:Hewlett-Packard;CMD:PJL,MLC,PCL,PCLXL,POSTSCRIPT;
        MDL:HP LaserJet 2200;CLS:PRINTER;DES:Hewlett-Packard LaserJet 2200;
        MEM:8MB
        location =

Device: uri = socket://192.168.7.235:9100
        class = network
        info = ENVY 4500 series
        make-and-model = HP ENVY 4500 series
        device-id = MFG:HP;MDL:ENVY 4500 series;CMD:PCL3GUI,PJL,Automatic,
                    JPEG,PCLM,AppleRaster,DW-PCL,802.11,DESKJET,DYN;
                    CLS:PRINTER;DES:A9T87B;CID:HPIJVIPAV4;LEDMDIS:USB#FF#CC#00,
                    USB#07#01#02,USB#FF#04#01;IPP-HTTP:T;IPP-E:
                    FF-CC-00,07-01-02,FF4-01;SN:CN56G332DT060D;
                    S:038080C484a01021002c1f3000ac2880014;J:;
                    Z:0102,05034ee800aaa8,0600,0c0,0e000c0000,0f01000000,
                    10000008000008,12000,147,150,16361a34ee000116da17d40001,
                    1700005a000000,180;
        location = Study

Device: uri = dnssd://ENVY4500._ipp._tcp.local/?uuid=1c852a4d-b800-1f08-abcd-308d99fafac2
        class = network
        info = ENVY4500
        make-and-model = HP ENVY 4500 series
        device-id = MFG:HP;MDL:ENVY 4500 series;CMD:PCL,JPEG,URF;
        location =

Device: uri = ipp://envy4500.local:631/ipp/print
        class = network
        info = HP ENVY 4500 series (driverless)
        make-and-model = HP ENVY 4500 series
        device-id = MFG:HP;MDL:ENVY 4500 series;CMD:PCLM,PCL,AppleRaster,JPEG,URF;
        location =
}}}
 * The USB connected printer has been located by two backends: ''usb'' and ''hp''. The first backend comes from CUPS and the second from [[#hplip|HPLIP]]. Either device-uri can be used for printing. However, if [[Scanner#aio|automatic scanner discovery]] on an [[PrintingGlossaryandIndex#mfd|MFD]] is wanted, the ''hp'' backend should be used to set up the queue.

 * Additionally, the ENVY 4500 has been found from its [[PrintingGlossaryandIndex#dnssd|DNS-SD]] broadcasts by the [[#dnssd|dnssd]] and [[#ipp|ipp]] backends. Either device-uri may be used. Both are equally as good for a [[CUPSDriverlessPrinting|driverless printing]] solution. The [[#backendchoice|snmp]] backend has also located this printer at 192.168.7.235:9100 and presents a non-driverless [[#appsocket|socket]] URI to use.
Line 160: Line 68:
The `dnssd://...` entries are either [[PrintingGlossaryandIndex#bonjour|Bonjour-broadcasted]] print queues from a CUPS server on a remote machine or [[AirPrint|Bonjour-enabled printers]]; DNS-SD has located them with the help of Avahi. In general, queues created with a `dnssd://...` device-uri and pointing to a server should be set up on the client as [[#raw|raw queues]] so that the [[#doublefiltering|filtering takes place]] entirely on the remote server.

If it is known that a queue on the remote machine is itself a raw one or the device-uri points to a printer, you might have to consider whether setting up a local raw queue achieves what you want (see [[Tea4CUPS]] for situations in which you would want a local raw queue).

{{{#!wiki note
A Bonjour-enabled printer would almost certainly require a local non-raw queue to be set up [[#lpadmin|manually]] or for a [[DriverlessPrinting|driverless printing]] technique to be used.
}}}

Which `dnssd://...` entries are queues and which are printers?
 * The ''dnssd://..'' entries are either [[PrintingGlossaryandIndex#bonjour|Bonjour-broadcasted]] print queues from a CUPS server on a remote machine or [[AirPrint|Bonjour-enabled printers]]; DNS-SD has located them with the help of [[DebPkg:avahi-daemon|Avahi]]. In general, queues created with a ''dnssd://...'' device-uri and pointing to a server, such the !LaserJet-300 entry, should be set up on the client as [[#raw|raw queues]] so that the [[#doublefiltering|filtering takes place]] entirely on the remote server.

 * Which ''dnssd://...'' entries are queues and which are printers?
Line 178: Line 79:
A client machine with a cups version greater than or equal to 1.6.x will have the `dnssd://...` queues and printers automatically found with [[DebianMan:avahi-daemon|avahi-daemon]] plus [[DebianMan:cups-browsed|cups-browsed]] and listed with

{{{
lpstat -t
 * A client machine with a CUPS version greater than or equal to 1.6.x will have the ''dnssd://...'' queues and printers automatically found with [[DebianMan:avahi-daemon|avahi-daemon]] plus [[DebianMan:cups-browsed|cups-browsed]] and listed with `lpstat -t`.

 * If it is known that a queue on the remote machine is itself a raw one or the device-uri points to a printer, you may have to consider whether setting up a local raw queue achieves what you want (see [[CUPSTea4CUPS]] for situations in which you would want a local raw queue).


{{{#!wiki important
Having a correct URI is critcal for printing to a printer or print queue.
Line 205: Line 108:
The choice of protocol will be driven by your needs and what is offered by the printer or print server. !AppSocket is non-complex, usually well-implemented, low overhead and reliably gets the data from point A to point B, but doesn't do much else. IPP provides bidirectional communication for feedback and control, secure authentication services, access control and printer discovery and status. Its use is mandatory on [[AirPrint|AirPrint]] and [[IPPEverywhere|IPP Everywhere]] printers. LPD is a popular protocol older than IPP and with a feature set less extensive than it. Secure access, detailed error status reports and the ability to query a printer are lacking, for example.

<<Anchor(appsock)>>
The choice of protocol will be driven by your needs and what is offered by the printer or print server. [[#appsocket|AppSocket]] is non-complex, usually well-implemented, low overhead and reliably gets the data from point A to point B, but doesn't do much else. [[#ipp|IPP]] provides bidirectional communication for feedback and control, secure authentication services, access control and printer discovery and status. Its use is mandatory on [[AirPrint|AirPrint]] and [[IPPEverywhere|IPP Everywhere]] printers. [[#lpd|LPD]] is a popular protocol older than IPP and with a feature set less extensive than it. Secure access, detailed error status reports and the ability to query a printer are lacking, for example.

<<Anchor(appsocket)>>
Line 223: Line 126:
Printing normally takes place over port 631 with the URI scheme being

{{{
ipp://<ip_address_or_hostname>:[port_number]/resource
}}}

Unfortunately, the ''resource'' path has never been standardised and it may require some experimentation to determine what a printer or server will accept, especially if the device is not on the local network or it does not do, as most modern printers do, [[PrintingGlossaryandIndex#bonjour|Bonjour]] broadcasting. Apparently, newer printers often use ''/ipp/print'' in the path but for older products (as well as newer ones) it could be something entirely different, like ipp/port1, ipp, ipp/printer or ipp/laserjet. Maybe the printer's front panel will help. Or
Printing normally takes place over port 631 with the URI scheme being either of these:

{{{
ipp://<ip_address_or_hostname>:[port_number]/resource   (buster)
1pp://<DNS-SD_name>._ipp._tcp.local/ (bullseye)

}}}

Unfortunately, the ''resource'' path has never been standardised and it may require some experimentation to determine what a printer or server will accept, especially if the device is not on the local network or it does not do, as most modern printers do, [[PrintingGlossaryandIndex#bonjour|Bonjour]] broadcasting. Apparently, newer printers often use ''/ipp/print'' in the resource path but for older products (as well as newer ones) it could be something entirely different, like ipp/port1, ipp, ipp/printer or ipp/laserjet. Maybe the printer's front panel will help. Or
Line 263: Line 167:
In theory, the handshaking and status monitoring done by the IPP protocol should ensure reliable printing but, in practice, there are older printers which do not implement some aspects of IPP very well. However, these days, a [[http://lists.cups.org/pipermail/cups/2015-October/027161.html|more optimistic view]] of the situation can be taken. In theory, the handshaking and status monitoring done by the IPP protocol should ensure reliable printing but, in practice, there are older printers that do not implement some aspects of IPP very well. However, these days, a [[http://lists.cups.org/pipermail/cups/2015-October/027161.html|more optimistic view]] of the situation can be taken.
Line 279: Line 183:
The cups package provides a [[DebianMan:debconf|debconf]] method for selecting [[#deviceuri|backends]] which are used for printer discovery and connection to the device. It basically gives a convenient way of copying the backends which come with CUPS between ''/usr/lib/cups/backend-available/'' and ''/usr/lib/cups/backend/''. Run The cups package provides a [[DebianMan:debconf|debconf]] method for selecting [[#deviceuri|backends]] that are used for printer discovery and connection to the device. It basically gives a convenient way of copying the backends that come with CUPS between ''/usr/lib/cups/backend-available/'' and ''/usr/lib/cups/backend/''. Run
Line 294: Line 198:
by the [[DebianPkg:cups-daemon|scheduler]] and the [[DebianPkg:cups-filters|filtering system]] and produce a final output which can be understood by the printer.

Drivers are in the printer-driver-* packages plus [[SystemPrinting|various other packages]]. The [[DebianPkg:task-print-server|print server task]] in Debian Installer gives you a full complement of these drivers. You may decline this task at install time but after first boot can do either

{{{
  apt-get install task-print-server
by the [[DebianPkg:cups-daemon|scheduler]] and the [[DebianPkg:cups-filters|filtering system]] and produce a final output that can be understood by the printer.

Vendor drivers are in the printer-driver-* packages plus [[SystemPrinting#intro|various other packages]]. The [[DebianBug:950553|print server task]] in Debian Installer gives you a full complement of these drivers. You may decline this task at install time but after first boot can do either

{{{
  apt install task-print-server
Line 305: Line 209:
  apt-get install cups   apt install cups
Line 310: Line 214:
 * Consult [[Printing#Resources|openprinting]] for ideas on available drivers.  * Consult [[https://openprinting.org/printers|OpenPrinting]] for ideas on available drivers.
Line 315: Line 219:
   apt-cache search search_term
}}}

 * Go to the [[PrintQueuesCUPS#nonfree|printer manufacturer's website]]
   apt search <search_term>
}}}

 * Go to the [[CUPSPrintQueues#nonfree|printer manufacturer's website]]
Line 322: Line 226:
Users who possess a [[QuickPrintQueuesCUPS#Introduction|modern printer]] are urged to consider a [[DriverlessPrinting|driverless printing]] solution (buster only), perhaps by setting up a [[DriverlessPrinting#shortlpadmin|suitable print queue]] or by following the [[QuickPrintQueuesCUPS|advice here]]. The days of CUPS continuing driver support in the form it is now [[https://github.com/apple/cups/issues/5271|are numbered]]. Users who possess a [[CUPSQuickPrintQueues#Introduction|modern printer]] are urged to consider a [[CUPSDriverlessPrinting|driverless printing]] solution (buster onwards), perhaps by setting up a [[SystemPrinting#utilities|suitable print queue]] or by following the [[CUPSQuickPrintQueues|advice here]]. The days of CUPS continuing driver support in the form it is now [[https://github.com/apple/cups/issues/5271|are numbered]].
Line 350: Line 254:
A goodly number of Epson printer drivers fall into the category of DFSG-free. These are gathered together in DebPkg:printer-driver-escpr. Free and non-free drivers may be located and downloaded from [[http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX|this Epson website]]. A goodly number of Epson printer drivers fall into the category of DFSG-free. These are gathered together in DebPkg:printer-driver-escpr. Free and non-free drivers may be located and downloaded from [[http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX|this Epson website]]. Some Epson drivers have the advice that

{{{
In order to install these drivers, you need to install LSB package (version 3.2 or later) beforehand.
}}}

The tip in [[DebianBug:958304|this bug report]] is worth taking note of.
Line 355: Line 264:
Linux support for a Samsung printer can be searched for from either the [[https://support.hp.com/gb-en/drivers|HP]] or [[https://samsung-printerdrivers.com/|Samsung]] web sites. Many, but not all, Samsung printer models use the ''Unified Linux Driver (ULD)''. ''ULD'' contains PPDs for Linux supported printers, a printer driver to use with the PPDs and a library to use with the driver. It comes in a ''.tar.gz'' package and only supports the i386 and amd64 platforms. No source code is provided. Linux support for a Samsung printer can be searched for from this [[https://support.hp.com/gb-en/drivers|HP website]]. Many, but not all, Samsung printer models use the ''Unified Linux Driver (ULD)''. ''ULD'' contains PPDs for Linux supported printers, a printer driver to use with the PPDs and a library to use with the driver. It comes in a ''.tar.gz'' package and only supports the i386 and amd64 platforms. No source code is provided. ULD is also employed [[#hpuld|to support some HP devices]].
Line 370: Line 279:
A relatively small number of HP devices require a plugin to be installed on the computer for them to [[https://developers.hp.com/hp-linux-imaging-and-printing/binaary_plugin.html|operate at all or to function at their full potential]] for one or more of the device's printing, scanning or faxing modes. For a handful of HP printers the plugin package contains firmware which has to be uploaded to a printer. Without a firmware requirement the plugin software can still be needed to interact with the printer. Effectively, the print job is processed by the plugin to produce a file in a language the printer understands. In technical literature the printer would be described as ''host-based''. See whether the plugin [[https://developers.hp.com/hp-linux-imaging-and-printing/supported_devices/index|is needed]] and use [[https://developers.hp.com/|HP's home page search facility]] to see a printer's details and find out what any firmware is required for. `hp-plugin -i` is a command to use to install the plugin. A relatively small number of HP devices requires a plugin to be installed on the computer for them to [[https://developers.hp.com/hp-linux-imaging-and-printing/binaary_plugin.html|operate at all or to function at their full potential]] for one or more of the device's printing, scanning or faxing modes. For a handful of HP printers the plugin package contains firmware that has to be uploaded to a printer. Without a firmware requirement the plugin software can still be needed to interact with the printer. Effectively, the print job is processed by the plugin to produce a file in a language the printer understands. In technical literature the printer would be described as ''host-based''. See whether the plugin [[https://developers.hp.com/hp-linux-imaging-and-printing/supported_devices/index|is needed]] and use [[https://developers.hp.com/|HP's home page search facility]] to see a printer's details and find out what any firmware is required for. `hp-plugin -i` is a command to use to install the plugin.
Line 386: Line 295:
<<Anchor(hpuld)>>
 * '''HP + ULD'''

There are HP devices that are not supported by the [[#hplip|HPLIP software]] but require the [[#samsung|Samsung Unified Driver (ULD) software]] for printing or scanning. Some such devices have PPDs and drivers in [[https://support.hp.com/us-en/drivers/selfservice/hp-laser-mfp-130-printer-series/24494378/model/24494382|uld-hp_V1.00.39.12_00.15.tar.gz]] and [[https://support.hp.com/gb-en/drivers/selfservice/hp-laserjet-mfp-m433-printer-series/20511305/model/20511306|uld-hp.tar.gz]]. The names of these packages and their contents have been known to change, so it may very well be best to search for them using a printer name. The devices catered for by the packages above are

{{{
 * HP Color Laser 15x Series
 * HP Color Laser MFP 17x Series
 * HP LaserJet MFP M43
 * HP LaserJet MFP M436
 * HP LaserJet MFP M72625 72630
 * HP Laser10x Series
 * HP Laser MFP 13x Series
}}}

A concise guide to installing the ULDLINUX package and setting up a USB-connected print queue with an appropriate PPD [[https://answers.launchpad.net/hplip/+question/689584|has been provided by Robert Nurnberg in Message #16]]. Adapting the guide for a wireless connection should not be difficult.
Line 389: Line 315:
Not the name of a printer manufacturer but a [[DebianPkg:printer-driver-foo2zjs|Debian package]] which can install firmware and colour profiles for a number of printers which use the [[http://http://foo2zjs.rkkda.com/|ZjStream wire protocol]]. The commands (as root) Not the name of a printer manufacturer but a [[DebianPkg:printer-driver-foo2zjs|Debian package]] that can install firmware and colour profiles for a number of printers that use the [[http://http://foo2zjs.rkkda.com/|ZjStream wire protocol]]. The commands (as root)
Line 396: Line 322:
give a list of what is available and download the firmware file for an HP !LaserJet P1008. [[DebianPkg:hannah-foo2zjs|Hannah]] is a graphical firmware downloader which uses getweb. Re-plug the connection to the printer to upload the firmware to it. give a list of what is available and download the firmware file for an HP !LaserJet P1008. [[DebianPkg:hannah-foo2zjs|Hannah]] is a graphical firmware downloader that uses getweb. Re-plug the connection to the printer to upload the firmware to it.
Line 419: Line 345:
Recent developments in printer technology see printers understanding MIME types ''image/pwg-raster'' and ''image/urf''. These file types are also referred to as PWG and Apple raster data formats respectively. Recent developments in printer technology see printers understanding MIME types [[PrintingGlossaryandIndex#pwgraster|image/pwg-raster]] and [[PrintingGlossaryandIndex#urf|image/urf]]. These file types are also referred to as PWG and Apple raster data formats respectively.
Line 429: Line 355:
From CUPS 2.2.2 and cups-filters 1.13.0 onwards it is possible to send a job in Apple and PWG raster to a printer which understands either data format. This is dealt with in more detail on the [[DriverlessPrinting|driverless printing]] page. From CUPS 2.2.2 and cups-filters 1.13.0 onwards it is possible to send a job in Apple and PWG raster to a printer that understands either data format. This is dealt with in more detail on the [[CUPSDriverlessPrinting|driverless printing]] page.

{{{#!wiki important
With a [[CUPSQuickPrintQueues|modern printer]] the use of non-free software or non-free plugins is completely avoidable.
}}}
Line 434: Line 364:
!PostScript Printer Description (PPD) files were originally used by
printers which operated with !PostScript as a Page Description
Language (PDL) for printing. They have been adapted to cope with other
standard printer languages such as HP's Printer Command Language (PCL)
and special (often proprietary) languages. [[#driver|Driver packages]] include
PPDs in their contents.
[[PrintingGlossaryandIndex#ppd|PostScript Printer Description]] (PPD) files were originally used by printers that operated with !PostScript as a [[PrintingGlossaryandIndex#pdl|Page Description Language]] (PDL) for printing. They have been adapted to cope with other standard printer languages such as HP's Printer Command Language (PCL) and special (often proprietary) languages. [[#driver|Driver packages]] include PPDs in their contents.
Line 447: Line 372:
If there is only one for your printer the choice is made for you! If there is more than one, go for the PPD which is marked ''Recommended''. If none are recommended use common sense or seek help from the [[Printing#Resources|openprinting database]].

Some Generic PPDs are listed with `lpinfo -m` and one could be a solution when every driver package is installed and your printer model is not in the list. You can also resort to the [[PrintQueuesCUPS#nonfree|printer manufacturer's website]] or a CD which came with the printer.
If there is only one for your printer, the choice is made for you! If there is more than one, go for the PPD that is marked ''Recommended''. If none are recommended, use common sense or seek help from the [[Printing#Resources|openprinting database]]. Some Generic PPDs are listed with `lpinfo -m` and one could be a solution when every driver package is installed and your printer model is not in the list. You can also resort to the [[CUPSPrintQueues#nonfree|printer manufacturer's website]] or a CD that came with the printer.
Line 461: Line 384:
 1. The queue name (-p): The printing system treats the name in a        case-insensitive manner; !LaserJet-300 is the same queue as laserjet-300. Chose any [[DebianMan:lpadmin|valid]] name that makes sense to you.  1. The queue name (-p): The printing system treats the name in a case-insensitive manner; !LaserJet-300 is the same queue as laserjet-300. Chose any [[DebianMan:lpadmin|valid]] name that makes sense to you.
Line 465: Line 388:
 3. The printer model (-m): Determines how the print job is handled by the filtering system to produce data which can be successfully printed by the printer. Options are to specify a [[#ppd|PPD]] or have a [[CUPSDriverlessPrinting#lpadmin|PPD generated]] from the printer response to being queried (see ''everywhere'' and ''driverless'') or [[#raw|raw]].  3. The printer model (-m): Determines how the print job is handled by the filtering system to produce data that can be successfully printed by the printer. Options are to specify a [[#ppd|PPD]] or have a [[CUPSDriverlessPrinting#lpadmin|PPD generated]] from the printer response to being queried (see ''everywhere'' and ''driverless'') or [[#raw|raw]].
Line 519: Line 442:
The Add Printer button could produce a first page with something like this on it:

{{{
             Local Printers: CUPS-BRF (Virtual Braille BRF Printer)
                                Serial Port #1
                                Serial Port #2
                                HP psc 1300 series USB HU3AFBQ28Y9F (HP psc 1300 series)
                                hp psc 1300 series (HP psc 1300 series)
                                HP Fax (HPLIP)
                                EPSON Stylus COLOR 740 LPT #1 (EPSON Stylus COLOR 740)
Discovered Network Printers: ENVY4500 (HP ENVY 4500 series)
                                LaserJet-300 @ desktop (HP HP LaserJet 2200)
                                HP LaserJet 2200 (HP LaserJet 2200)
                                ENVY 4500 series (HP ENVY 4500 series)
                                ENVY 4500 series (driverless) (HP ENVY 4500 series)
     Other Network Printers: AppSocket/HP JetDirect
                                Internet Printing Protocol (ipps)
                                Internet Printing Protocol (ipp14)
                                Internet Printing Protocol (https)
                                Internet Printing Protocol (http)
                                LPD/LPR Host or Printer
                                Internet Printing Protocol (ipp)
}}}

This doesn't look significantly different from what `lpinfo` gave [[#deviceuri|previously]] as backends have once again been run in [[#deviceuri|discovery mode]] to find printers.

 * Under ''Local Printers'' are the discovered printers which are directly connected to the computer being used. ''Printer'' in this context refers to a real machine or a virtual printer such as [[DebPkg:printer-driver=cups-pdf|cups-pdf]]. Note that the ''PSC 1300'' has been discovered by the ''usb'' and ''hp'' backends. The ''hp:/usb/...'' connection should be chosen if it is desired to make scanning from an [[PrintingGlossaryandIndex#mfd|MFD]] ''automatically'' available to a [[Scanner#front|SANE frontend]].

 * ''Discovered Network Printers'' are networked printers on the same subnet as the computer. Or they could be print queues that the [[#dnssd|dnssd backend]] has found on the same subnet. The [[#deviceuri|device-uri]] discovered is on the second page of the interface. Note that the ENVY4500, an [[CUPSDriverlessPrinting|IPP and AirPrint]] printer, has been discovered by the ''dnssd'', ''driverless'' and ''[[#backendchoice|snmp]]'' backends. On Debian 10 (buster) and later this would strongly indicate selecting either the ''IPP Everywhere'' or ''driverless'' Model entry on the interface's third page.
The Add Printer button could produce a first page showing something like this on a bullseye OS:

{{{
             Local Printers: [ ] CUPS-PDF (Virtual PDF Printer)
                                [ ] CUPS-BRF (Virtual Braille BRF Printer)
                                [ ] EPSON Stylus Photo RX420 (EPSON Stylus Photo RX420)
                                [ ] hp psc 1300 series (HP psc 1300 series)
                                [ ] HP psc 1300 series USB HU3AFBQ28Y9F (HP psc 1300 series)
                                [ ] HP ENVY 4500 series USB CN56G332DT060D HPLIP (HP ENVY 4500 series)
                                [ ] HP Fax (HPLIP)
Discovered Network Printers: [ ] LaserJet-300 @ desktop (HP LaserJet 2200)
                                [*] ENVY 4500 series (fully driverless) (HP ENVY 4500 series)
     Other Network Printers: [ ] Internet Printing Protocol (ipps)
                                [ ] Backend Error Handler
                                [ ] Internet Printing Protocol (http)
                                [ ] LPD/LPR Host or Printer
                                [ ] AppSocket/HP JetDirect
                                [ ] Internet Printing Protocol (ipp)
                                [ ] Internet Printing Protocol (https)
}}}

[[#deviceuri|As before]], backends have been run in discovery mode to find printers and print queues. The above display is a transcript taken from the image forming the basis of a [[SystemPrinting#webinterface|previous account of the CUPS web interface]]. Note carefully that the modern ENVY 4500 is USB connected and using the [[DriverlessPrinting#debian|IPP-over-USB protocol]], so all the comments in that account concerning this protocol apply here too.

 * Under ''Local Printers'' are the discovered printers that are directly connected to the computer being used. ''Printer'' in this context refers to a real machine or a virtual printer such as [[DebPkg:printer-driver=cups-pdf|cups-pdf]]. The psc 1300 and EPSON Stylus are legacy printers and will [[SystemPrinting#intro|require drivers]]. Note that the psc 1300 has been discovered by the ''usb'' and [[#hplip|hp]] backends. The ''hp:/usb/...'' connection should be chosen if it is desired to make scanning from an [[PrintingGlossaryandIndex#mfd|MFD]] [[https://wiki.debian.org/Scanner#aio|automatically available]] to a [[Scanner#front|SANE frontend]].

{{{#!wiki important
The USB entry for the ENVY 4500 [[CUPSDriverlessPrinting#debian|cannot be used]] to set up a '''working''' print queue when bullseye is the OS. Under ''Discovered Network Printers'' look to use model/driver entries on the third page that comtain ''driverless'' or ''IPP Everywhere''.
}}}

 * ''Discovered Network Printers'' are networked printers on the same subnet as the computer. Or they could be print queues (these entries display an @ in a name) that the [[#dnssd|dnssd backend]] has found on the same subnet.
Line 556: Line 480:
Moving on to the third page you should find that the [[DriverlessPrinting|Everywhere Model]] or a PPD has been selected Moving on to the third page you should find that the [[CUPSDriverlessPrinting|Everywhere Model]] or a PPD has been selected
Line 566: Line 490:
The final page has the default printer-specific options from the PPD and a few non-specific printer options. This should suit the needs of many users. The final page has the default printer-specific options from the PPD and a few non-specific printer options. These defaults should suit the needs of many users.
Line 571: Line 495:
[[DebianPkg:hplip|HPLIP]] is a [[https://developers.hp.com/hp-linux-imaging-and-printing/tech_docs/overview|one-stop]] solution for printing, scanning and faxing with appropriate HP devices and designed to work with CUPS. Only the printing aspect is dealt with here. USB scanning is the subject of [[Scanner|another wiki page]] and network scanning is linked from it. HPLIP uses its own printer backend, `hp:/...`, and [[#deviceuri|URI scheme]] for printer discovery and sending a print-ready job to the printer. For a graphical user interface (GUI) to HPLIP there is a [[DebianPkg:hplip-gui|hplip-gui]], which contains very similar utilities to the ones in the hplip package. [[DebianPkg:hplip|HPLIP]] is a [[https://developers.hp.com/hp-linux-imaging-and-printing/tech_docs/overview|one-stop]] solution for printing, scanning and faxing with appropriate HP devices and designed to work with CUPS. Only the printing aspect is dealt with here. USB scanning is the subject of [[Scanner|another wiki page]] and network scanning is linked from it. HPLIP uses its own printer backend, ''hp:/...'', and [[#deviceuri|URI scheme]] for printer discovery and sending a print-ready job to the printer. For a graphical user interface (GUI) to HPLIP there is a [[DebianPkg:hplip-gui|hplip-gui]], which contains very similar utilities to the ones in the hplip package. [[https://developers.hp.com/hp-linux-imaging-and-printing/supported_devices/index|This page]] lists the HP devices that are supported by HPLIP.

Be aware that the hplip package can be dispensed with for printing on a [[CUPSQuickPrintQueues|modern]] HP printer because it is most probably well suited to [[CUPSDriverlessPrinting|driverless printing]]. Only DebPkg:libsane-hpaio might be needed for scanning: `apt install --no-install-recommends libsane-hpaio`.
Line 582: Line 508:
hp:/net/<printer_model>?zc=<zeroconf(avahi, Bonjour)_hostname> hp:/net/<printer_model>?zc=<bonjour_hostname>
Line 603: Line 529:
''hp-setup'' uses one of two methods to find printers on the network - Service Location Protocol (SLP) and mdns (Bonjour) broadcasts from [[AirPrint|suitable printers]]. ''hp-setup'' uses one of two methods to find printers on the network - [[WikiPedia:Service_Location_Protocol|Service Location Protocol]] (SLP) and mdns ([[PrintingGlossaryandIndex#bonjour|Bonjour]]) broadcasts from [[AirPrint|suitable printers]].
Line 609: Line 535:
will tell you. executed with root privileges will tell you.
Line 613: Line 539:
 1. hp-probe -mmdns (This provides a Device URI).
 2. hp-setup -i -d<Device URI>
 1. hp-probe -mmdns (This provides a device URI).
 2. hp-setup -i -d<device_URI>
Line 621: Line 547:
 * HP printing devices can be set up with [[#networkuri|device-uri schemes]] other than `hp:/...` provided CUPS and a suitable printer-driver package such as DebianPkg:printer-driver-hpcups, DebianPkg:printer-driver-hpijs or DebianPkg:printer-driver-postscript-hp have, as a minimum, been installed. Printer discovery would be done through any of [[#lpadmin|lpadmin]], the [[#webinterface|CUPS web interface]] or [[#scp|system-config-printer]].  * HP printing devices can be set up with [[#networkuri|device-uri schemes]] other than ''hp:/...'' provided CUPS and a suitable printer-driver package such as DebianPkg:printer-driver-hpcups, DebianPkg:printer-driver-hpijs or DebianPkg:printer-driver-postscript-hp have, as a minimum, been installed. Printer discovery would be done through any of [[#lpadmin|lpadmin]], the [[#webinterface|CUPS web interface]] or [[#scp|system-config-printer]]. Bear in mind that, depending on the [[CUPSQuickPrintQueues|age]] of the printer and the [[#deviceuri|connection type]], ''automatic'' scanner discovery on an HP [[PrintingGlossaryandIndex#mfd|MFD]] may become unavailable if this is done.

 * Users with a [[CUPSQuickPrintQueues|modern]] network-capable HP printer or [[PrintingGlossaryandIndex#mfd|MFD]] who do not want to rely on HPLIP (a [[#hp|non-free plugin]], for example), have a decent, alternative solution available for [[DriverlessPrinting|printing]].
Line 626: Line 554:
The idea of system-config-printer is to provide functionality similar to [[#lpadmin|lpadmin]] and the CUPS [[#webinterface|web interface]] but with GTK+ widgets and greater desktop integration. Anyone familiar with the CUPS web interface should feel at home with it but note that there is a difference in the way adminstrator privileges for the printing system are gained.

A default system-config-printer installs [[DebianPkg:cups-pk-helper|cups-pk-helper]] as a recommended package to further the aim of desktop integration. ''cups-pk-helper'' is intended to give [[http://www.vuntz.net/journal/post/2010/02/19/A-few-words-about-cups-pk-helper...|fine-grained control]] of aspects of CUPS management via [[DebianPkg:policykit-1|policykit]]. Unlike lpadmin, the CUPS web interface and HPLIP ''cups-pk-helper'' [[DebianBug:698504|does not respect]] the ''!SystemGroup lpadmin'' directive in ''/etc/cups/cups-files.conf'' and an adminstrator password will be requested to see remote print queues and to administer them and local queues.

{{attachment:scp-1.png||align=left}}

Almost nothing is administratively possible for an ordinary user when ''cups-pk-helper'' is on the machine. A user is entitled to cancel her own jobs but without the machine's administrator altering policykit's view of who is entitled to administer printers nothing else is available.

This can be done with a file ending with ''.pkla'' put into ''/etc/polkit-1/localauthority/50-local.d''. With the contents
The idea of system-config-printer is to provide functionality similar to [[#lpadmin|lpadmin]] and the CUPS [[#webinterface|web interface]] but with greater desktop integration rather than interacting with a commandline or browser interface. However, anyone familiar with the CUPS web interface should feel at home with using it. Please see [[SystemPrinting#scp|this other page]] for a view on how system-config-printer behaves on a default bullseye installation..

The initial screen seen when ''system-config-printer'' is run displays icons and names for local print queues; that is, queues that have been set up by a user or by [[#cupsbrowsed|cups-browsed]]. The ''Add'' button is for printer discovery and creating a new queue for a printer. A greyed-out button indicates a lack of some administrative privilege, so go to ''Server-->Connect-->Connect''.
Hopefully, the [[#deviceuri|device-uri]] and [[#webinterface|CUPS web interface]] sections will be found useful for interpreting and acting on the discovered printers display.

 * There is a difference in the way adminstrator privileges for the printing system are gained with system-config-printer compared with lpadmin and the CUPS web interface.


A default jessie or stretch
system-config-printer installs [[DebianPkg:cups-pk-helper|cups-pk-helper]] as a recommended package to further the aim of desktop integration. ''cups-pk-helper'' is intended to give [[http://www.vuntz.net/journal/post/2010/02/19/A-few-words-about-cups-pk-helper...|fine-grained control]] of aspects of CUPS management via [[DebianPkg:policykit-1|policykit]]. Unlike lpadmin, the CUPS web interface and [[#hplip|HPLIP]], the ''cups-pk-helper'' utility [[DebianBug:698504|does not respect]] the ''!SystemGroup lpadmin'' directive in [[#confs|cups-files.conf]] and an adminstrator password will be requested to see remote print queues and to administer them and local queues.

 * Almost nothing is administratively possible for an ordinary user when ''cups-pk-helper'' is on the machine. A user is entitled to cancel her own jobs but, without the machine's administrator altering policykit's view of who is entitled to administer printers, nothing else is available.

This situation may be altered by the administrator putting a file ending with ''.pkla'' into ''/etc/polkit-1/localauthority/50-local.d''. ''99-printer.pkla'' would be a suitable name for the file. With its contents being
Line 646: Line 578:
those granted to a member of the lpadmin group and not have to provide a password. Removing the cups-pk-helper package would be an alternative strategy to allow users in the lpadmin group administrative privileges.

The initial screen seen when ''system-config-printer'' is run displays icons and names for local print queues; that is, queues which been set up by a user or by [[#cupsbrowsed|cups-browsed]]. The ''Add'' button is for printer discovery and creating a new queue for a printer. A greyed-out button indicates a lack of some administrative privilege, so go to ''Server-->Connect-->Connect''.
Hopefully, the [[#deviceuri|device-uri]] section will be found useful for interpreting the discovered printers display.
those granted to a member of the lpadmin group and not have to provide a password.

 * Removing the cups-pk-helper package would be an alternative strategy to allow users in the lpadmin group administrative privileges.
Line 720: Line 651:
Firefox, Evince and Zathura are examples of applications which use the GTK print dialog. The Qt print dialog is used in Okular and Qpdfview. Libreoffice has its own print dialog. Some but not all programs expecting ```lp``` can instead use ```gtklp```. Printing with ```lp``` or ```lpr``` is accomodated by the first and third methods. DebPkg:Firefox, DebPkg:Evince and DebPkg:Zathura are examples of applications that use the GTK print dialog. The Qt print dialog is used in DebPkg:Okular and DebPkg:Qpdfview. DebPkg:Libreoffice has its own print dialog. Some but not all programs expecting ```lp``` can instead use ```gtklp```. Printing with ```lp``` or ```lpr``` is accomodated by the first and third methods.
Line 726: Line 657:
8.x or 9.x client machine if you want

 * to discover [[#autodiscovery|remote]] print queues broadcast with DNS-SD (Bonjour broadcasting) and
 * have them automatically available in the print dialogs of GUI applications and usable by command line programs.

It is [[#tempq|not necessary]] on 10.x, but could be seen as desirable if it deals with a situation CUPS cannot handle. An example might be the [[https://github.com/apple/cups/issues/5011|filtering of print queues]] from a print dialog.
8 (jessie) or 9 (stretch) client machine if it is wanted

 * To discover [[#autodiscovery|remote]] print queues broadcast with DNS-SD ([[PrintingGlossaryandIndex#bonjour|Bonjour broadcasting]]).
 * Have print queues automatically available in the print dialogs of GUI applications and usable by command line programs.

cups-browsed is [[#tempq|not necessary]] on Debian 10 (buster), but could be seen as desirable if it deals with a situation CUPS cannot handle. An example might be the [[https://github.com/apple/cups/issues/5011|filtering of print queues]] from a print dialog.
Line 764: Line 695:
Since version 2.2.4 CUPS has gained the ability to browse the DNS-SD broadcasts of remote [[#autodiscovery|print queues and printers]] picked up by avahi-daemon. Discovered remote queues and IPP printers can be listed in the print dialogs of applications without having a local queue. On accessing a listed queue to print a job, CUPS on the client machine creates a PPD using the [[DriverlessPrinting#lpadmin|everywhere model]]. This queue is temporary and disappears a minute after being idle (or when the cups service is stopped). The intent is that a queue is added only when it is needed to print something and there is no need to use memory, CPU cycles, etc for printers that are only created just in case the user wants to print. Since version 2.2.4 CUPS has gained the ability to browse the DNS-SD broadcasts of remote [[#autodiscovery|print queues and printers]] picked up by avahi-daemon. Discovered remote queues and IPP printers can be listed in the print dialogs of applications without having a local queue. On accessing a listed queue to print a job, CUPS on the client machine creates a PPD using the [[CUPSDriverlessPrinting#lpadmin|everywhere model]]. This queue is temporary and disappears a minute after being idle (or when the cups service is stopped). The intent is that a queue is added only when it is needed to print something and there is no need to use memory, CPU cycles, etc for printers that are only created just in case the user wants to print.
Line 788: Line 719:
Displaying and printing to a queue advertised by a remote CUPS server should present no difficulty. However, although the GTK print dialog can detect an IPP printer, it would appear [[DriverlessPrinting#gtk|not to support printing to it]]. Displaying and printing to a queue advertised by a remote CUPS server should present no difficulty. However, although the GTK print dialog can detect an IPP printer, it would appear [[CUPSDriverlessPrinting#gtk|not to support printing to it]].
Line 791: Line 722:
 * The [[PrintingGlossaryandIndex#dialog|print dialogs]] of Qt applications (DebPkg:Okular, DebPkg:Konqueror etc) and DebPkg:LibreOffice [[DriverlessPrinting#tempq|enumerate]] printers and queues using CUPS to browse [[PrintingGlossaryandIndex#dnssd|DNS-SD]] advertised queues and printers.  * The [[PrintingGlossaryandIndex#dialog|print dialogs]] of Qt applications (DebPkg:Okular, DebPkg:Konqueror etc) and DebPkg:LibreOffice [[CUPSDriverlessPrinting#tempq|enumerate]] printers and queues using CUPS to browse [[PrintingGlossaryandIndex#dnssd|DNS-SD]] advertised queues and printers.
Line 796: Line 727:
Print queue availability by browsing the Bonjour broadcasts from a server is a dynamic process. Queues will come and go as they are enabled and disabled or as a client is moved from network to network. In a world which more and more has a
focus on mobile devices there are benefits to be gained from avahi-daemon and cups-browsed or from a print dialog which implements Avahi discovery itself.
Print queue availability by browsing the Bonjour broadcasts from a server is a dynamic process. Queues will come and go as they are enabled and disabled or as a client is moved from network to network. In a world that more and more has a
focus on mobile devices there are benefits to be gained from avahi-daemon and cups-browsed or from a print dialog that implements Avahi discovery itself.
Line 831: Line 762:
These are located in ''/etc/cups'' as [[DebianMan:cupsd.conf|cupsd.conf]] and [[DebianMan:cups-files.conf|cups-files.conf]]. The existence of two files arises from a [[DebianBug:692791|Debian bug report]] which lead to the fixing of a privilege escalation from lpadmin to root on systems with all options contained in cupsd.conf, as they were at that time. These are located in ''/etc/cups'' as [[DebianMan:cupsd.conf|cupsd.conf]] and [[DebianMan:cups-files.conf|cups-files.conf]]. The existence of two files arises from a [[DebianBug:692791|Debian bug report]] that lead to the fixing of a privilege escalation from lpadmin to root on systems with all options contained in cupsd.conf, as they were at that time.
Line 870: Line 801:
and, for a setting which is not displayed: and, for a setting that is not displayed:

Translation(s): none


Setting up and administering print queues within the CUPS printing system. Aimed at a Debian 11 (bullseye) installation, but much of the material should apply to Debian 10 (buster), Debian 9 (stretch) and Debian 8 (jessie) too.

Introduction

The major changes in Debian 10 (buster) compared with the two previous stable distributions have to do with driverless printing. It is offered on Debian 9, but CUPS, cups-filters and cups-browsed have augmented their software to include more filters and options to take advantage of modern-day printing technology. For CUPS it is worth mentioning the introduction of temporary queue formation and Apple Raster as a supported PDL. For cups-filters there is now a rastertopclm filter and cups-browsed has more support for setting up driverless printing automatically.

The single most important change in Debian 11 (bullseye) concerns the extension of driverless printing to include modern printers that support IPP-over-USB. Connecting a modern MFD to a USB port should see a print queue established automatically. An alternative to auto-setup is to install a queue manually. The situation regarding whether all modern USB-only printer devices understand IPP-over-USB is unclear. However, many modern MFDs have been observed to interwork with this protocol.

Users of legacy printers (printers that depend on what the vendor software supplies) should be unaffected by these changes for now.

A document destined for a printer or print server is frequently called a print job. On its way there it is first put into a queue before being processed. The queue has certain properties which determine how the print job is dealt with and may be queried with lpoptions and lpstat for a list of these properties and the queue status repectively.

The properties specified when the queue is created are not immutable. Quite a few of them can be altered by a user via lp or an application when the print job is submitted to the queue. A user can also set default printing options in ~/.cups/lpoptions. An administrator who hoped to confine users to duplex (two-sided) printing, for example, would have to look outside the CUPS framework for a solution to add to the system.

Several queues can point to the same physical device, the printer, but it is very common for print queue and printer to be used interchangably. No harm need come from this, but it pays to give careful attention to whether a CUPS print server or a printer is being contacted. This account treats general principles and manual setup of a queue first; automatic setup and a glimpse of a modern development follow later.

The device-uri

Ultimately, a print job has to go somewhere; most users expect the job to go to a printer. However, the job is only going to get to the printer or print queue (after being taken out of the CUPS queue) if the device-uri (or, for short, URI) is one recognised by CUPS and the printer or print queue. lpinfo allows you to see which device-uris and drivers (backends) are associated with a print server or a printer:

/usr/sbin/lpinfo -v

Backends in /usr/lib/cups/backends are now used in discovery mode in an endeavour to locate printers. Here is the output of one such command when an legacy HP PSC 1300 is attached to a Debian 10 (buster) machine via USB and two printers are available over the network (a legacy HP LaserJet 2200 and an modern HP ENVY 4500). Execute /usr/sbin/lpinfo -l -v for more detail.

This output was produced from a machine with a buster installation. On a bulleye machine the final line would have a different format.

network lpd
network ipp
network http
network socket
network beh
network https
network ipps
direct usb://hp/psc%201300%20series?serial=HU3AFBQ28Y9F&interface=1
direct hp:/usb/psc_1300_series?serial=HU3AFBQ28Y9F
direct hpfax
network dnssd://LaserJet-300%20%40%20desktop._ipp._tcp.local/cups?uuid=325fb239-90e7-3a46-7835-1e12939a1ba5
network dnssd://ENVY4500._ipp._tcp.local/?uuid=1c852a4d-b800-1f08-abcd-308d99fafac2
network socket://192.168.7.235:9100
network ipp://ENVY4500.local:631/ipp/print  
  • The USB connected printer has been located by two backends: usb and hp. The first backend comes from CUPS and the second from HPLIP. Either device-uri can be used for printing. However, if automatic scanner discovery on an MFD is wanted, the hp backend should be used to set up the queue.

  • Additionally, the ENVY 4500 has been found from its DNS-SD broadcasts by the dnssd and ipp backends. Either device-uri may be used. Both are equally as good for a driverless printing solution. The snmp backend has also located this printer at 192.168.7.235:9100 and presents a non-driverless socket URI to use.

  • The dnssd://.. entries are either Bonjour-broadcasted print queues from a CUPS server on a remote machine or Bonjour-enabled printers; DNS-SD has located them with the help of Avahi. In general, queues created with a dnssd://... device-uri and pointing to a server, such the LaserJet-300 entry, should be set up on the client as raw queues so that the filtering takes place entirely on the remote server.

  • Which dnssd://... entries are queues and which are printers?

/usr/lib/cups/backend/dnssd > dnssd.log

grep "local/cups" dnssd.log      (These are print queues).
grep "local/?uuid" dnssd.log     (These are printers).
grep "Unknown" dnssd.log         (These are raw print queues).
  • A client machine with a CUPS version greater than or equal to 1.6.x will have the dnssd://... queues and printers automatically found with avahi-daemon plus cups-browsed and listed with lpstat -t.

  • If it is known that a queue on the remote machine is itself a raw one or the device-uri points to a printer, you may have to consider whether setting up a local raw queue achieves what you want (see CUPSTea4CUPS for situations in which you would want a local raw queue).

Having a correct URI is critcal for printing to a printer or print queue.

The device-uri for a Networked Printer

CUPS can use at least one of the AppSocket, Internet Printing (IPP) and Line Printer (LPD) protocols for connecting to printers and print servers over a network connection. For a view of which services a device supports there is the nmap command:

nmap <ip_address_or_hostname>

The output will vary from printer to printer. For an HP Envy 4500 it is

PORT     STATE SERVICE
80/tcp   open  http
443/tcp  open  https
631/tcp  open  ipp
8080/tcp open  http-proxy
9100/tcp open  jetdirect
9220/tcp open  unknown

The choice of protocol will be driven by your needs and what is offered by the printer or print server. AppSocket is non-complex, usually well-implemented, low overhead and reliably gets the data from point A to point B, but doesn't do much else. IPP provides bidirectional communication for feedback and control, secure authentication services, access control and printer discovery and status. Its use is mandatory on AirPrint and IPP Everywhere printers. LPD is a popular protocol older than IPP and with a feature set less extensive than it. Secure access, detailed error status reports and the ability to query a printer are lacking, for example.

  • AppSocket

Also known as the JetDirect or RAW protocol, this is the most basic protocol that can be supported by a printer. The URI scheme is

socket://<ip_address_or_hostname>:[port_number]

The standard port number is 9100 and this will be used by default if omitted from the device-uri. Print servers with three outputs would require three port numbers; for example, 9100, 9101 and 9102.

It is questionable whether AppSocket is a protocol. There is no specified standard for it; no queue management; no aborting of jobs; no querying of printer supplies; no encryption. All it does is shovel the data for a print-ready file over the network and then close the connection. Because the only overhead is TCP/IP the data transfer is generally fast. Also, it has been in widespread use for a long time so the printer implementations of AppSocket are good.

  • IPP

Printing normally takes place over port 631 with the URI scheme being either of these:

ipp://<ip_address_or_hostname>:[port_number]/resource   (buster)
1pp://<DNS-SD_name>._ipp._tcp.local/                    (bullseye)

Unfortunately, the resource path has never been standardised and it may require some experimentation to determine what a printer or server will accept, especially if the device is not on the local network or it does not do, as most modern printers do, Bonjour broadcasting. Apparently, newer printers often use /ipp/print in the resource path but for older products (as well as newer ones) it could be something entirely different, like ipp/port1, ipp, ipp/printer or ipp/laserjet. Maybe the printer's front panel will help. Or

/usr/lib/cups/backend/snmp <ip_address>

could give suitable output if there is explicit information from the Port Monitor MIB (Management Information Base) database of the printer. In the absence of an MIB the probing is for AppSocket, then LPD and the first that works is reported. Because AppSocket is supported by most network printers it would likely be the protocol given for use in a URI. So not so useful for getting an IPP URI.

If an IPP printer has registered itself using Avahi, more success with obtaining an IPP URI could be achieved by installing avahi-utils, running avahi-browse and looking at the rp= TXT Record Key:

avahi-browse -art | less

An additional technique is to install cups-ipp-utils and execute ippfind:

ippfind                         (Shows IPP printers and print queues).
ippfind -T 5                    (Possibly more reliable).
ippfind ! --txt printer-type    (Show IPP printers only).

An alternative command (which relies on ippfind) is

driverless

A CUPS server can always be reached with

ipp://<ip_address_or_hostname>/printers/<print_queue_name>

In theory, the handshaking and status monitoring done by the IPP protocol should ensure reliable printing but, in practice, there are older printers that do not implement some aspects of IPP very well. However, these days, a more optimistic view of the situation can be taken.

  • LPD

This is the original network protocol. It has a URI scheme of

lpd://<ip_address_or_hostname>/<print_queue_name>

and a default port of 515. Even though AppSocket and IPP are seen as better alternatives, it is regarded as a reliable protocol for sending a job to a printer. CUPS itself has some limited functionality for LPD-based clients

Configuring the Choice of Backend

The cups package provides a debconf method for selecting backends that are used for printer discovery and connection to the device. It basically gives a convenient way of copying the backends that come with CUPS between /usr/lib/cups/backend-available/ and /usr/lib/cups/backend/. Run

dpkg-reconfigure cups

Note that not every backend on the system is managed with this command because they are not all in the cups package. For example, the parallel and beh backends are in the cups-filters package.

Be careful about which backends are removed from the debconf list. Deleting the dnssd backend would still allow remote Bonjour broadcasted queue discovery via cups-browsed but Bonjour broadcasted printers would not seen by CUPS. An AppSocket-enabled printer would be discoverable with the snmp backend but, if the socket backend was deleted, trying to set up a queue using a socket://... URI would give the error Bad device-uri scheme "socket".

Printer Drivers

The job of a printer driver is to ensure that printing options are applied by the scheduler and the filtering system and produce a final output that can be understood by the printer.

Vendor drivers are in the printer-driver-* packages plus various other packages. The print server task in Debian Installer gives you a full complement of these drivers. You may decline this task at install time but after first boot can do either

  apt install task-print-server

or

  apt install cups

If a driver/PPD for your printer is not in any of the installed packages you have various choices open to you:

  • Consult OpenPrinting for ideas on available drivers.

  • Hunt down an appropriate package with

   apt search <search_term>

Users who possess a modern printer are urged to consider a driverless printing solution (buster onwards), perhaps by setting up a suitable print queue or by following the advice here. The days of CUPS continuing driver support in the form it is now are numbered.

Non-free Printer Drivers and Firmware

Driver software distributed with quite a few printers does not meet the criterion of being DFSG-free, so users who need to use such a driver with a printer will have to rely completely on what the printer manufacturer has to offer to get their printer working. Also, even though most HP printers operate with DFSG-free software, some HP devices used with hplip require a proprietary host-based driver plugin or a firmware file to allow full access to printer or scanner features or enhanced performance. The firmware is uploaded to the printer when it is powered-on attached to the computer. The host-based plugin software is used when printing or scanning.

It may be necessary to go to the manufacturer's website if the printer is a new model and drivers for it are not yet in a Debian package (or never will be) and driverless printing is not an option. However, it would be highly unlikely that a modern, AirPrint-enabled printer would not be a good fit for driverless printing on Debian 10 (buster) and later, and therefore a user is advised to follow this route for a quick, efficient and almost effortless modern printer setup.

  • Brother

Solutions for Linux is a good place to start for assessing what support your printer has from Brother. Generally, you will need .deb files for the cupswrapper and the lpr driver. Follow the instructions to install them; alternatively, there is linux-brprinter-installer to do that for you.

  • Canon

There is a Canon wiki page dealing with printers requiring URF-II, CAPT and cnijfilter drivers. A Canon Advanced Printing Technology (CAPT) printing package and a cnijfilter package can be installed in a similar way to Method 1 at the previous link. Namely: extract files from the package with tar zvxf..... and install Debian packages with apt install ./....

Some useful phrases for locating Canon packages on the web are:

  • cnijfilter debian 5.70
  • ufr printer driver for linux
  • capt printer driver for linux

Alternatively, search for a package from a Canon website

  • Epson

A goodly number of Epson printer drivers fall into the category of DFSG-free. These are gathered together in printer-driver-escpr. Free and non-free drivers may be located and downloaded from this Epson website. Some Epson drivers have the advice that

In order to install these drivers, you need to install LSB package (version 3.2 or later) beforehand.

The tip in this bug report is worth taking note of.

  • Samsung

Linux support for a Samsung printer can be searched for from this HP website. Many, but not all, Samsung printer models use the Unified Linux Driver (ULD). ULD contains PPDs for Linux supported printers, a printer driver to use with the PPDs and a library to use with the driver. It comes in a .tar.gz package and only supports the i386 and amd64 platforms. No source code is provided. ULD is also employed to support some HP devices.

Extract the files in the tarball and install them by entering the directory created and running install-printer.sh

tar zvxf uld_v1.00.xx_xx.xx.tar.gz
cd uld
./install-printer.sh

Samsung does not provide ULD as a .deb but the The Samsung Unified Linux Driver Repository does. It also has a good deal of information on the installation of ULD and its interaction with a Debian system. SULDR is not affiliated with Samsung.

  • HP

A relatively small number of HP devices requires a plugin to be installed on the computer for them to operate at all or to function at their full potential for one or more of the device's printing, scanning or faxing modes. For a handful of HP printers the plugin package contains firmware that has to be uploaded to a printer. Without a firmware requirement the plugin software can still be needed to interact with the printer. Effectively, the print job is processed by the plugin to produce a file in a language the printer understands. In technical literature the printer would be described as host-based. See whether the plugin is needed and use HP's home page search facility to see a printer's details and find out what any firmware is required for. hp-plugin -i is a command to use to install the plugin.

Plugin software can be installed (as root) without the hplip package and its dependencies being on the system.

  • apt install hplip-data

  • Download the appropriate plugin file to a chosen directory.

  • sh hplip-<version>-plugin.run --tar vxf

  • python installPlugin.py or python3 installPlugin.py

  • apt purge hplip-data

  • HP + ULD

There are HP devices that are not supported by the HPLIP software but require the Samsung Unified Driver (ULD) software for printing or scanning. Some such devices have PPDs and drivers in uld-hp_V1.00.39.12_00.15.tar.gz and uld-hp.tar.gz. The names of these packages and their contents have been known to change, so it may very well be best to search for them using a printer name. The devices catered for by the packages above are

 * HP Color Laser 15x Series
 * HP Color Laser MFP 17x Series
 * HP LaserJet MFP M43
 * HP LaserJet MFP M436
 * HP LaserJet MFP M72625 72630
 * HP Laser10x Series
 * HP Laser MFP 13x Series

A concise guide to installing the ULDLINUX package and setting up a USB-connected print queue with an appropriate PPD has been provided by Robert Nurnberg in Message #16. Adapting the guide for a wireless connection should not be difficult.

  • foo2zjs (firmware and colour profiles)

Not the name of a printer manufacturer but a Debian package that can install firmware and colour profiles for a number of printers that use the ZjStream wire protocol. The commands (as root)

getweb | less
getweb p1008

give a list of what is available and download the firmware file for an HP LaserJet P1008. Hannah is a graphical firmware downloader that uses getweb. Re-plug the connection to the printer to upload the firmware to it.

Avoiding Non-free Printer Drivers and Firmware

A non-free filter generally gets used at the last stage of the filtering process after cups-filters has done its job. The process ends with something that is sometimes termed host-based (and which is often proprietary) rather than letting the printer itself take care of the final conversion. It makes sense to the printer manufacturer to do this (probably on legal, technical or economic grounds) but it disrupts the free software ecosystem within which CUPS and cups-filters operate.

           +----------------------+    +-----------------+
File in -> |CUPS and cups-filters | -> | Non-free driver | -> Printer
           +----------------------+    +-----------------+

The final stage of this process could be dispensed with if what was sent to the printer was something it could understand.

                                        +------------------------+
           +-----------------------+    | Something the printer  |
File in -> | CUPS and cups-filters | -> | understands sent by    | -> Printer
           +-----------------------+    | CUPS and cups filters. |        
                                        +------------------------+

Recent developments in printer technology see printers understanding MIME types image/pwg-raster and image/urf. These file types are also referred to as PWG and Apple raster data formats respectively.

                                        +--------------+
           +-----------------------+    | Apple raster |
File in -> | CUPS and cups-filters | -> | or           | -> Printer
           +-----------------------+    | PWG raster   |     
                                        +--------------+

From CUPS 2.2.2 and cups-filters 1.13.0 onwards it is possible to send a job in Apple and PWG raster to a printer that understands either data format. This is dealt with in more detail on the driverless printing page.

With a modern printer the use of non-free software or non-free plugins is completely avoidable.

The PPD File

PostScript Printer Description (PPD) files were originally used by printers that operated with PostScript as a Page Description Language (PDL) for printing. They have been adapted to cope with other standard printer languages such as HP's Printer Command Language (PCL) and special (often proprietary) languages. Driver packages include PPDs in their contents.

A searchable list of PPDs on your system is obtained with

/usr/sbin/lpinfo -m | less

If there is only one for your printer, the choice is made for you! If there is more than one, go for the PPD that is marked Recommended. If none are recommended, use common sense or seek help from the openprinting database. Some Generic PPDs are listed with lpinfo -m and one could be a solution when every driver package is installed and your printer model is not in the list. You can also resort to the printer manufacturer's website or a CD that came with the printer.

It is convenient (and probably sensible) to put a PPD obtained from elsewhere in /usr/share/ppd/custom. It will then be displayed in the outputs of lpinfo -m, the web interface and system-config-printer.

Creating a Print Queue with lpadmin

This is the basic method to set up a queue. It is used behind the scenes with system-config-printer (s-c-p), HPLIP, cups-browsed and the CUPS web interface. There are four essentials to provide when setting up a working, accepting print queue with lpadmin.

  1. The queue name (-p): The printing system treats the name in a case-insensitive manner; LaserJet-300 is the same queue as laserjet-300. Chose any valid name that makes sense to you.

  2. The device-uri (-v): The destination for a print job; usually a printer but may be a queue on a CUPS server.

  3. The printer model (-m): Determines how the print job is handled by the filtering system to produce data that can be successfully printed by the printer. Options are to specify a PPD or have a PPD generated from the printer response to being queried (see everywhere and driverless) or raw.

  4. Whether the queue is enabled (-E): Must be specified explicitly.

With this information the queue is set up with

lpadmin -p <queue_name> -v <device-uri> -m <PPD_or_everywhere_or_driverless_or_raw> -E

Sometimes it is necessary or desirable to establish a raw queue. That is, a queue where the filtering system is not involved and the print job goes directly to a printer or another queue:

lpadmin -p <queue_name> -v <device-uri> -E -m raw

lpoptions is the command to use to see default options for the queue (obtained from the PPD):

lpoptions -p <queue_name> -l

The previous lpadmin command is about as simple as it gets for setting up a queue quickly, but it can be tweaked just as simply by giving the command some queue-specific options to add with -o. For example, to have duplex printing as a default for a driverless queue:

lpadmin -p <queue_name> -v <device-uri> -o sides-default=two-sided-long-edge -m everywhere -E

The lpadmin and lp manuals are sources for non-PPD options.

Setting up a queue with lpadmin or the web interface requires either root privileges or for the user to be a member of the lpadmin group. If you installed CUPS using the printserver task in the Debian installer, the first user is put in the lpadmin group.

Check for user membership of the lpadmin group with the command

groups

If lpadmin doesn't appear in the previous command output execute this command if you wish (change username with your user name):

usermod -a -G lpadmin <username>

Creating a Print Queue with the CUPS Web Interface

http://localhost:631 is the location of the interface and from there you can administer print queues, including their installation. Administrative tasks are able to be completed by giving the username root and root's password or providing the username and password of an lpadmin group member.

The Add Printer button could produce a first page showing something like this on a bullseye OS:

             Local Printers:    [ ] CUPS-PDF (Virtual PDF Printer)
                                [ ] CUPS-BRF (Virtual Braille BRF Printer)
                                [ ] EPSON Stylus Photo RX420 (EPSON Stylus Photo RX420)
                                [ ] hp psc 1300 series (HP psc 1300 series)
                                [ ] HP psc 1300 series USB HU3AFBQ28Y9F (HP psc 1300 series)
                                [ ] HP ENVY 4500 series USB CN56G332DT060D HPLIP (HP ENVY 4500 series)
                                [ ] HP Fax (HPLIP)
Discovered Network Printers:    [ ] LaserJet-300 @ desktop (HP LaserJet 2200)
                                [*] ENVY 4500 series (fully driverless) (HP ENVY 4500 series)
     Other Network Printers:    [ ] Internet Printing Protocol (ipps)
                                [ ] Backend Error Handler
                                [ ] Internet Printing Protocol (http)
                                [ ] LPD/LPR Host or Printer
                                [ ] AppSocket/HP JetDirect
                                [ ] Internet Printing Protocol (ipp)
                                [ ] Internet Printing Protocol (https)

As before, backends have been run in discovery mode to find printers and print queues. The above display is a transcript taken from the image forming the basis of a previous account of the CUPS web interface. Note carefully that the modern ENVY 4500 is USB connected and using the IPP-over-USB protocol, so all the comments in that account concerning this protocol apply here too.

  • Under Local Printers are the discovered printers that are directly connected to the computer being used. Printer in this context refers to a real machine or a virtual printer such as cups-pdf. The psc 1300 and EPSON Stylus are legacy printers and will require drivers. Note that the psc 1300 has been discovered by the usb and hp backends. The hp:/usb/... connection should be chosen if it is desired to make scanning from an MFD automatically available to a SANE frontend.

The USB entry for the ENVY 4500 cannot be used to set up a working print queue when bullseye is the OS. Under Discovered Network Printers look to use model/driver entries on the third page that comtain driverless or IPP Everywhere.

  • Discovered Network Printers are networked printers on the same subnet as the computer. Or they could be print queues (these entries display an @ in a name) that the dnssd backend has found on the same subnet.

  • Other Network Printers gives you the opportunity to provide the device uri and PPD for a printer or queue that falls into neither of the previous two categories. The information to be provided is asked for on the second and third pages.

Having made a selection from Local Printers: or Discovered Network Printers: you should find a queue name based on the printer make and model has been filled in for you on the next page. Change it by all means if you wish. Once it is done it cannot be modified later because a new name would imply setting up a different, new queue.

Share printers connected to this system on the Administration page is the basic facility to allow (or not allow) DNS-SD broadcasting of any queue. Ticking Share This Printer on the second page designates your queue as one to add to this facility.

Moving on to the third page you should find that the Everywhere Model or a PPD has been selected for you, unless

  • The printer or queue doesn't fit the everywhere model.
  • The printer or queue provides no make and model information to CUPS.
  • There is no PPD for the printer or queue on the system.
  • Other Network Printers is being used.

The previous driver and PPD comments apply here too.

The final page has the default printer-specific options from the PPD and a few non-specific printer options. These defaults should suit the needs of many users.

Creating a Print Queue with HPLIP

HPLIP is a one-stop solution for printing, scanning and faxing with appropriate HP devices and designed to work with CUPS. Only the printing aspect is dealt with here. USB scanning is the subject of another wiki page and network scanning is linked from it. HPLIP uses its own printer backend, hp:/..., and URI scheme for printer discovery and sending a print-ready job to the printer. For a graphical user interface (GUI) to HPLIP there is a hplip-gui, which contains very similar utilities to the ones in the hplip package. This page lists the HP devices that are supported by HPLIP.

Be aware that the hplip package can be dispensed with for printing on a modern HP printer because it is most probably well suited to driverless printing. Only libsane-hpaio might be needed for scanning: apt install --no-install-recommends libsane-hpaio.

  • URI scheme: USB printer.

hp:/usb/<printer_model>?serial=<serial_number>
  • URI scheme: networked printer.

hp:/net/<printer_model>?ip=<IP_address>
hp:/net/<printer_model>?hostname=<DNS_hostname>
hp:/net/<printer_model>?zc=<bonjour_hostname>
  • URI scheme: parallel port printer.

hp:/par/<printer_model>?device=/dev/parportX (X=1,2...)

Each printer model supported by the installed verion of HPLIP is listed in /usr/share/hplip/data/models/models.dat. Model names are enclosed in square brackets; like so, [envy_4500_series].

Printer discovery and setting up a print queue can be done from the command line with hp-setup. For USB and printers on the network:

hp-setup -i -busb
hp-setup -i -bnet

You will be led through the rest of the procedure.

hp-setup uses one of two methods to find printers on the network - Service Location Protocol (SLP) and mdns (Bonjour) broadcasts from suitable printers.

The SLP service agent runs on port 427 of a printer; do you have such a service?

  • nmap -sU -p 427 <ip_address>

executed with root privileges will tell you.

The command hp-setup -i -bnet uses only SLP for discovery. If you want to setup a queue for an mdns advertised printer it is suggested to do

  1. hp-probe -mmdns (This provides a device URI).
  2. hp-setup -i -d<device_URI>

A problem with firewall settings could lead to the first command failing.

Creating a Print Queue with system-config-printer

The idea of system-config-printer is to provide functionality similar to lpadmin and the CUPS web interface but with greater desktop integration rather than interacting with a commandline or browser interface. However, anyone familiar with the CUPS web interface should feel at home with using it. Please see this other page for a view on how system-config-printer behaves on a default bullseye installation..

The initial screen seen when system-config-printer is run displays icons and names for local print queues; that is, queues that have been set up by a user or by cups-browsed. The Add button is for printer discovery and creating a new queue for a printer. A greyed-out button indicates a lack of some administrative privilege, so go to Server-->Connect-->Connect. Hopefully, the device-uri and CUPS web interface sections will be found useful for interpreting and acting on the discovered printers display.

  • There is a difference in the way adminstrator privileges for the printing system are gained with system-config-printer compared with lpadmin and the CUPS web interface.

A default jessie or stretch system-config-printer installs cups-pk-helper as a recommended package to further the aim of desktop integration. cups-pk-helper is intended to give fine-grained control of aspects of CUPS management via policykit. Unlike lpadmin, the CUPS web interface and HPLIP, the cups-pk-helper utility does not respect the SystemGroup lpadmin directive in cups-files.conf and an adminstrator password will be requested to see remote print queues and to administer them and local queues.

  • Almost nothing is administratively possible for an ordinary user when cups-pk-helper is on the machine. A user is entitled to cancel her own jobs but, without the machine's administrator altering policykit's view of who is entitled to administer printers, nothing else is available.

This situation may be altered by the administrator putting a file ending with .pkla into /etc/polkit-1/localauthority/50-local.d. 99-printer.pkla would be a suitable name for the file. With its contents being

[Printer configuration]
Identity=unix-user:milly;unix-user:molly;unix-user:mandy
Action=org.opensuse.cupspkhelper.mechanism.*
ResultAny=no
ResultInactive=no
ResultActive=yes

the users milly, molly, mandy would have privileges granted similar to those granted to a member of the lpadmin group and not have to provide a password.

  • Removing the cups-pk-helper package would be an alternative strategy to allow users in the lpadmin group administrative privileges.

Double Filtering

The CUPS web interface and the command /usr/sbin/lpinfo -v give a list of printers and print queues discovered on the network. Any of the entries in the list can be installed as a local print queue. In other words they will listed in /etc/cups/printers.conf on your machine.

For example, under Discovered Network Printers in the web interface you might see

testq @ desktop (DCP-9020CDW)

and the next web page shows a Connection beginning dnssd://.

The dnssd:// and @ desktop tell you this is a print queue discoverd by avahi-daemon. The (DCP-9020CDW) tells you the make and model of the printer. The latter information is obtained from the *Product line in the queue's PPD, so it implies the queue is not a raw queue and a job sent to it undergoes filtering on the server. The same information is given in the make-and-model field of the output of /usr/sbin/lpinfo -l -v.

On the third web page you should choose Raw as the Make. With lpadmin you should have -m raw. Then the client passes the data through without filtering and all filtering is done correctly on the server.

Alternatively, you can get such queues automatically set up locally by running cups-browsed on the client.

Upstream CUPS has something to say about double filtering. Quoting:

The issue is the MIME typing on the CUPS server - if the server
doesn't recognize the MIME media type then you may end up with
extra filtering.

I'm not saying it can't work (because we have customers that use
that configuration all of the time), it is just that we get a lot
of support calls when people try to do Microsoft-style printer
sharing to a server that is also hosting a CUPS printer driver on
the same queue.

Reinforcing the previous point:

The issue is that for IPP we actually get to use MIME media types,
and the filters in the PPD file specify what the final output type
is. We then try to match things up on the remote system, which is
where the problems typically occur. For example, if the local
driver has a filter that specifies application/vnd.hp-pcl" as the
destination MIME media type but the server does not have that MIME
media type defined/supported for its queue, we have to revert to
"application/octet-stream" (auto-detect).

You can "fix" this with .types and .convs files on the server 
to specify a "-" filter for the affected MIME media types to
application/vnd.cups-raw) but ultimately you are better off
letting the server do the filtering...

You are strongly advised not to do double filtering. Set up the queue on the client as a raw queue if the remote queue is doing the filtering.

Auto-discovery of Remote, Shared Queues and Printers

All four of the previous setup tools for print queue creation (lpadmin, the CUPS web interface, hp-setup and s-c-p) are manual tools and the created queues are also permanent. There is often no need for this permanancy, especially when moving from network to network. Having queues set up automatically and then automatically disappearing when they go offline or are no longer required is useful for conserving resources and having an up-to-date enumeration of queues and printers.

There are currently three methods for getting information from avahi-daemon and automatically displaying print queues and IPP printers in a print dialog.

  • Use cups-browsed to manage queues and printers.

  • Have the dialog itself browse the DNS-SD broadcasts of the queues and printers using avahi-daemon.

  • Use CUPS version 2.2.4 or later versions. They support discovery of Bonjour advertised print queues and printers.

Firefox, Evince and Zathura are examples of applications that use the GTK print dialog. The Qt print dialog is used in Okular and Qpdfview. Libreoffice has its own print dialog. Some but not all programs expecting lp can instead use gtklp. Printing with lp or lpr is accomodated by the first and third methods.

cups-browsed

This package was introduced for CUPS 1.6.x and is necessary on a Debian 8 (jessie) or 9 (stretch) client machine if it is wanted

  • To discover remote print queues broadcast with DNS-SD (Bonjour broadcasting).

  • Have print queues automatically available in the print dialogs of GUI applications and usable by command line programs.

cups-browsed is not necessary on Debian 10 (buster), but could be seen as desirable if it deals with a situation CUPS cannot handle. An example might be the filtering of print queues from a print dialog.

The change in CUPS 1.6.x came about because upstream CUPS abandoned CUPS browsing as a way of broadcasting and discovering print queues and printers. There is a number of issues inherent in this method, as this mail explains. cups-browsed was devised to bring about backward compatibility and give continuity to the printing system. It does not intend to be available in perpetuity. With the arrival of CUPS 2.2.4 the cups-browsed author reassessed his work for the future:

In small home networks and on mobile devices cups-browsed is not 
actually needed any more, as the IPP backend replaces it in this simple 
case of not needing load-balancing printer clusters and remote CUPS 
servers being CUPS 1.6.x or newer.

cups-browsed will be continued, to provide additional functionality, 
especially interoperability of CUPS 1.5.x or older with CUPS 1.6.x or 
newer, to create load-balancing printer clusters, and to allow complex 
filtering on which remote queues/printers one wants to see and which not.

Comprehensive documention is in /usr/share/doc/cups/README.Debian.gz, /etc/cups/cups-browsed.conf, cups-browsed and cups-browsed.conf. There are significant differences in the cups-browsed facilities, such as driverless printing, provided on jessie, stretch and buster.

The avahi-daemon package also needs to be installed on the client. The default cups-browsed.conf is set to do both DND-SD (Bonjour) discovery (CUPS only offers Bonjour broadcasting) and, for legacy purposes, CUPS IPP discovery of print queues. A server with a CUPS version of 1.6.x or greater does not need cups-browsed to do DNS-SD broadcasting but avahi-daemon is required.

DNS-SD Broadcasting (Server)

DNS-SD Discovery (Client)

Debian Version

wheezy

jessie, stretch and buster

wheezy

jessie and stretch

buster

cups-browsed needed

Not available

{X}

Not available
Use dnssd backend

(./)

{X}
Optional

avahi-daemon needed

(./)

(./)

(./)

(./)

(./)

Legacy CUPS Broadcasting (Server)

Legacy CUPS Discovery (Client)

Debian Version

wheezy

jessie, stretch and buster

wheezy

jessie, stretch and buster

cups-browsed needed

{X}
Not available

(./)

{X}
Not available

(./)

avahi-daemon needed

{X}

{X}

{X}

{X}

Temporary Queue Creation by CUPS

Since version 2.2.4 CUPS has gained the ability to browse the DNS-SD broadcasts of remote print queues and printers picked up by avahi-daemon. Discovered remote queues and IPP printers can be listed in the print dialogs of applications without having a local queue. On accessing a listed queue to print a job, CUPS on the client machine creates a PPD using the everywhere model. This queue is temporary and disappears a minute after being idle (or when the cups service is stopped). The intent is that a queue is added only when it is needed to print something and there is no need to use memory, CPU cycles, etc for printers that are only created just in case the user wants to print.

Having cups-browsed running leads to its controlling automatic queue creation instead. By default cups-browsed will use the same destination name as the CUPS temporary queue creation mechanism does (LocalQueueNamingRemoteCUPS DNS-SD in cups-browsed.conf). This allows it to overwrite a temporary queue and set up a local queue with the same name.

Qt applications and libreoffice use the CUPS temporary queue facility to form their print dialogs. lp and lpr can also use it. First discover local and remote queues and printers (note that lpstat -a shows only local queues):

lpstat -e

Then print to a chosen one:

lp -d <printer_or_print_queue>

Printing and GTK Applications

The sections on cups-browsed and temporary queues might give the impression that remote printers and print queues cannot be discovered, and printing cannot take place from Debian 8, 9 and 10 clients, without either of them. This is not quite the case; it all depends on what you are printing from. Nevertheless, it is worth highlighting that

  • cups-browsed promotes printing from all applications and from the command line.
  • Temporary queue formation is a central feature in the Qt and LibreOffice print dialogs.

Firefox, Evince and gedit (to name but three applications) use the GTK print dialog as a printing subsystem. The subsystem gets remote print queue and printer information directly from Avahi and the queues appear in the print dialogs of those applications. cups-browsed and temporary queues aren't needed and neither for that matter is CUPS. This means that printers and print queues get broadcasted via Bonjour and an application's GTK print dialog browses the Bonjour broadcasts to add available remote printers and queues to its list.

Displaying and printing to a queue advertised by a remote CUPS server should present no difficulty. However, although the GTK print dialog can detect an IPP printer, it would appear not to support printing to it.

Printing Without a Local CUPS Server

Print queue availability by browsing the Bonjour broadcasts from a server is a dynamic process. Queues will come and go as they are enabled and disabled or as a client is moved from network to network. In a world that more and more has a focus on mobile devices there are benefits to be gained from avahi-daemon and cups-browsed or from a print dialog that implements Avahi discovery itself.

However, it is possible a static configuration is entirely suitable for some purposes. In other words, no avahi-daemon, no cups-browsed and no cupsd running on a machine and instead connecting directly to a designated server. The first step is to read this manual. Then

apt-get install cups-client

followed by making the directory ~/.cups and putting a file client.conf in it.

mkdir ~/.cups
touch ~/.cups/client.conf

The content of client.conf could be as simple as

ServerName 192.168.7.20

The local queue is eliminated and print jobs from all applications and the command line go straight to ServerName for processing. There is the bother of changing ServerName when moving from network to network but this may be balanced by not having to run three daemons,

Even a client.conf may be dispensed with if the only printing to take place is from the command line. At its simplest:

lp -h <server_IP_or_hostname> -d <print_queue_on_server> <print_job?

Configuration Files for the Scheduler, cupsd

These are located in /etc/cups as cupsd.conf and cups-files.conf. The existence of two files arises from a Debian bug report that lead to the fixing of a privilege escalation from lpadmin to root on systems with all options contained in cupsd.conf, as they were at that time.

cups-files is editable only by root. cupsd.conf can be edited by root and, from the web interface only, by a user who is a member of the lpadmin group. After editing either file cupsd has to be restarted:

service cups restart

It can be very convenient to change some of the cupsd.conf settings with cupsctl (as root only). The current settings displayed by

cupsctl

might be

_debug_logging=0
_remote_admin=0
_remote_any=0
_share_printers=0
_user_cancel_any=0
BrowseLocalProtocols=dnssd
DefaultAuthType=Basic
JobPrivateAccess=default
JobPrivateValues=default
MaxLogSize=0
SubscriptionPrivateAccess=default
SubscriptionPrivateValues=default
WebInterface=Yes

Change a displayed setting with

cupsctl Webinterface=no

and, for a setting that is not displayed:

cupsctl SystemdIdleExit=Off

More than one line in cupsd.conf can be changed with some commands and cupsd is restarted when cupsctl is used. cups-files cannot be altered with cupsctl.

See Also


CategoryPrinter