:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for Mac OS® X and other UNIX®-like operating systems''".

+

:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".

Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.

Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.

Line 24:

Line 25:

==Cups Linux Printing workflow==

==Cups Linux Printing workflow==

As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For

As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For

−

further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart Cups filtering chart] for history and fun.

+

further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart CUPS filtering chart] for history and fun.

A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].

A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].

Line 34:

Line 35:

The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[Official repositories]].

The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[Official repositories]].

−

Then add your cups server IP or hostname into /etc/cups/client.conf. That's all you need. Every application should quickly find the printer(s) shared by that cups server.

+

Then add your CUPS server's IP address or hostname into {{ic|/etc/cups/client.conf}}. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.

===Optional advanced network setup===

===Optional advanced network setup===

−

It is also possible to run a entire cupsd instance on your client with avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.

+

It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.

−

{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now needs avahi to discover unknown printers}}

+

{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.

+

To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browserd (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers.}}

==Installing the server packages==

==Installing the server packages==

The packages {{Pkg|cups}}, {{Pkg|cups-filters}}, {{Pkg|ghostscript}}, {{Pkg|gsfonts}} and some printer driver are needed. [[pacman|Install]] them from the [[Official repositories]].

The packages {{Pkg|cups}}, {{Pkg|cups-filters}}, {{Pkg|ghostscript}}, {{Pkg|gsfonts}} and some printer driver are needed. [[pacman|Install]] them from the [[Official repositories]].

* '''hpoj''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread].

* '''hpoj''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread].

Line 57:

Line 59:

Here are some of the driver packages. Choosing the right driver depends on the printer:

Here are some of the driver packages. Choosing the right driver depends on the printer:

−

* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostSscript, CUPS, Foomatic, and the [[GIMP]]

+

* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostScript, CUPS, Foomatic, and the [[GIMP]]

* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".

* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".

* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].

* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].

−

* '''{{Pkg|hplip}}''' - HP GNU/Linux driver. Provides support for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.

+

* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.

* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the Samsung ML-2160. Package is available in the [[AUR]].

+

* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the [[AUR]].

* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].

* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].

* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it

* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it

Line 82:

Line 84:

==Configuring==

==Configuring==

−

Now that CUPS is installed, there are a variety of options on how to setup printing solutions. As always, the tried and true command line method is at your disposal. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. However, in order to make this process easy for the largest amount of users, this article will focus on the web interface provided by CUPS.

+

Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. However, in order to make this process easy for the largest amount of users, this article will focus on the web interface provided by CUPS.

If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.

If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.

Line 94:

Line 96:

====USB printers====

====USB printers====

−

{{Warning|As of Cups version 1.6.0 it's typically no more needed to blacklist the usblp kernel module!}}

+

{{Warning|As of {{pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.}}

−

If you find out this is the only way to fix a remaining issue please report this upstream to the cups tracker and maybe also get in contact with Till Kamppeter (Debian cups maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.

+

If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.

Some USB printer users may want to try if blacklisting the {{ic|usblp}} module would help:

Some USB printer users may want to try if blacklisting the {{ic|usblp}} module would help:

Line 130:

Line 132:

lp0: using parport0 (polling).

lp0: using parport0 (polling).

−

If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in /etc/cups/printers.conf:

+

If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in {{ic|/etc/cups/printers.conf}}:

DeviceID = parallel:/dev/usb/lp0

DeviceID = parallel:/dev/usb/lp0

====Auto-loading====

====Auto-loading====

−

It is convenient to have the system automatically load the kernel module every time it starts up. To do so, use a text editor to open up {{ic|/etc/modules-load.d/[[printing.conf]]}} and add the appropriate modules one per line. Here is an example:

+

It is convenient to have the system automatically load the kernel module every time it starts up. To do so, use a text editor to open up {{ic|/etc/modules-load.d/printing.conf}} and add the appropriate modules one per line. Here is an example:

lp

lp

parport

parport

Line 140:

Line 142:

===CUPS daemon===

===CUPS daemon===

−

With the kernel modules installed, you can now [[Daemon#Performing daemon actions manually|start the cupsd daemon]]. Add {{ic|cupsd}} to your [[daemons#Starting on Boot|DAEMONS array]] so it starts automatically on boot.

+

With the kernel modules installed, you can now [[Systemd#Using_units|start the cups service]] and [[Systemd#Using_units|start the cups-browserd service]]. You may want to enable the these services so that it [[Daemon#Starting_on_Boot|starts automatically on boot]].

=== Web interface and tool-kit ===

=== Web interface and tool-kit ===

Line 146:

Line 148:

Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hosts}}).

Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hosts}}).

−

From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label ( e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.

+

From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.

Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.

Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.

−

{{Tip|See: [[#Alternative CUPS interfaces]] for other other frontends.}}

+

{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}

{{Note|When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize

{{Note|When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize

your printer.}}

your printer.}}

−

{{Note|To enable wireless scanning on certain HP multifunction devices using the [http://www.archlinux.org/packages/extra/i686/hplip/ hplip] package, you may need to add the printer as a Network Printer using the http:// protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}

+

{{Note|To enable wireless scanning on certain HP multi-function devices using the {{pkg|hplip}} package, you may need to add the printer as a Network Printer using the http:// protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}

−

==== CUPS administration ====

==== CUPS administration ====

−

A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root (change this by editing {{ic|/etc/cups/cupsd.conf}} in the line of ''SystemGroup'').

+

A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root (change this by editing {{ic|/etc/cups/cupsd.conf}} in the line of {{ic|SystemGroup}}).

If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username and password. In this case, follow [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions] on the CUPS FAQ. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post].

If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username and password. In this case, follow [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions] on the CUPS FAQ. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post].

Line 246:

Line 247:

The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.

The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.

−

To use the new configuration, copy /etc/cups/cupsd.conf.default to /etc/cups/cupsd.conf (backup the old configuration if needed):

+

To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.

−

# cp /etc/cups/cupsd.conf.default /etc/cups/cupsd.conf

−

and restart CUPS to employ the new settings.

====All jobs are "stopped"====

====All jobs are "stopped"====

Line 268:

Line 267:

And restart CUPS (as pointed out in gutenprint's post-install message)

And restart CUPS (as pointed out in gutenprint's post-install message)

−

−

===USB printers under CUPS 1.4.x===

−

New CUPS 1.4.x introduces many changes:

−

−

====Device node permissions====

−

Some device may not be set with proper permission, especially when you blacklist the usblp module (no more needed as of cups version 1.6.x). CUPS needs the ownership of the USB device file of the printer to be root:lp, and permissions to be 660, e.g.

−

$ ls -l /dev/bus/usb/003/002

−

crw-rw---- 1 root lp 189, 257 20. Okt 10:32 /dev/bus/usb/003/002

−

−

This is supposed to be achieved by two udev rules in /lib/udev/rules.d/50-udev-default.rules:

−

# hplip and cups 1.4+ use raw USB devices, so permissions should be similar to

However, for some devices, in particular combined printer/scanner devices, these rules either do not trigger, or are overwritten by rules of the 'sane' package. In these cases a custom udev rule needs to be added. See below.

−

−

=====Device node permission troubleshooting=====

−

Get the printer's device file and its permissions with:

−

$ lsusb

−

...

−

Bus 003 Device 002: ID 04b8:0841 Seiko Epson Corp.

−

$ ls -l /dev/bus/usb/003/002

−

crw-rw---- 1 root lp 189, 257 20. Okt 10:32 /dev/bus/usb/003/002

−

−

If the permissions are not already root:lp 660, enforce it by creating a custom udev rule, e.g.

* {{ic|idVendor}} and {{ic|idProduct}} are from the {{ic|lsusb}} listing above.

−

* some printers will need permissions to be {{ic|666}}

−

* on my machine the propper folder is {{ic|/usr/lib/udev/rules.d}}

−

}}

−

−

=====Loading firmware=====

−

−

Some printers and drivers need to load firmware to the printer (such as HP LaserJet 10xx printers using foo2zjs) and do this by writing directly to the lp device, a functionality provided by usblp. A work around until this issue is resolved is to install the usblp module until the firmware is loaded, then remove the module to allow CUPS to work. This can be accomplished by manually running "$ modprobe usblp", waiting for the firmware to load, then "$ rmmod usblp". You can also not blacklist usblp, then put "rmmod usblp" to /etc/rc.local, allowing the firmware to be loaded on boot before rc.local is run, then removing usblp.

−

−

In case the printer is plugged in or powered on while system is already running, /etc/rc.local does not get executed and usblp module stays loaded. A workaround is to modify the /etc/udev/rules.d/11-hpj10xx.rules provided by foo2zjs so that after the add event we wait, e.g. 15 seconds for the firmware to load and then automatically remove usblp. The following example is for HP LaserJet 1018. For other models the value of ATTRS{idProduct} should be changed to match the printer model.

−

−

Locate the line matching your printer in /etc/udev/rules.d/11-hpj10xx.rules:

This happens on hp printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.

+

This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.

−

Some hp printers (e.g hp Laserjet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.

+

Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.

As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter

As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter

or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group_management|add the user to the lp group]].

+

or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp group]].

This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).

This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).

Line 366:

Line 308:

or:

or:

PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!

PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!

−

make sure '''hplip''' has been installed, in addition to [[#Packages|the packages mentioned above]], '''net-snmp''' is also needed. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post].

+

make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.

−

# pacman -S hplip

====Printing fails with unauthorised error====

====Printing fails with unauthorised error====

Line 384:

Line 325:

Restart CUPS:

Restart CUPS:

−

# /etc/rc.d/cupsd restart

+

# systemctl restart cups

====Unknown supported format: application/postscript====

====Unknown supported format: application/postscript====

Line 408:

Line 349:

smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series

smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series

as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.

as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.

+

If it won't work try '%20' instead of spaces.

====Print-Job client-error-document-format-not-supported====

====Print-Job client-error-document-format-not-supported====

Line 435:

Line 377:

If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.

If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.

−

−

====Installed Printers Do Not Appear in Print Dialogs After Installing/Upgrading to Systemd====

−

Systemd uses a different cups socket file located at:

−

−

'''/usr/lib/systemd/system/cups.socket'''

−

−

The default cups socket file is located at:

−

−

'''/var/run/cups/cups.sock'''

−

−

Edit '''/etc/cups/cupsd.conf''' and '''/etc/cups/client.conf''' as root to use the Systemd socket instead of the default. Make sure to restart CUPS when you are done:

−

−

# /etc/rc.d/cupsd restart

−

====CUPS prints only an empty and an error-message page on HP LaserJet====

====CUPS prints only an empty and an error-message page on HP LaserJet====

Line 465:

Line 393:

In order to fix the issue, use the following command (as superuser):

In order to fix the issue, use the following command (as superuser):

lpadmin -p <printer> -o pdftops-renderer-default=pdftops

lpadmin -p <printer> -o pdftops-renderer-default=pdftops

+

+

===="Using invalid Host" error message====

+

+

Try to add "ServerAlias *" into cupsd.conf

+

+

====Printer is not recognized by CUPS====

+

+

If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by lpinfo -v, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):

+

+

# Stop cups (sudo systemctl stop cups)

+

# Add the following udev rule in the following new rule /etc/udev/rules.d/10-cups_device_link.rules

+

KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"

+

# Unplug and re-plug the printer

+

# Wait a few and then start cups again (sudo systemctl start cups)

==Appendix==

==Appendix==

===Alternative CUPS interfaces===

===Alternative CUPS interfaces===

−

If using [[GNOME]], a possibility is to manage and configure the printer by using system-config-printer-gnome. This package is available through pacman:

+

If using [[GNOME]], a possibility is to manage and configure the printer by [[pacman|installing]] {{Pkg|system-config-printer-gnome}}.

−

# pacman -S system-config-printer-gnome

For system-config-printer to work as it should, running as root may be required, or alternatively set up a "normal" user to administer CUPS (if so '''follow steps 1-3''')

For system-config-printer to work as it should, running as root may be required, or alternatively set up a "normal" user to administer CUPS (if so '''follow steps 1-3''')

Line 482:

Line 423:

* 3. Restart cups, log out and in again (or restart computer)

* 3. Restart cups, log out and in again (or restart computer)

−

{{bc|# rc.d restart cupsd}}

+

{{bc|# systemctl restart cups}}

[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.

[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.

−

There is also [https://aur.archlinux.org/packages.php?ID=43505 gtklp] in the [[AUR]]

+

There is also {{AUR|gtklp}} in the [[AUR]].

===PDF virtual printer===

===PDF virtual printer===

CUPS-PDF is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. Obviously this package is not necessary, but it can be quite useful.

CUPS-PDF is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. Obviously this package is not necessary, but it can be quite useful.

−

Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit /etc/cups/cups-pdf.conf by changing the line

+

Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit {{ic|/etc/cups/cups-pdf.conf}} by changing the line

#Out /var/spool/cups-pdf/${USER}

#Out /var/spool/cups-pdf/${USER}

Line 503:

Line 444:

After installing the package, set it up as if it were for any other printer by using the web interface. For the Device, select '''CUPS-PDF (Virtual PDF Printer)'''; Make/Manufacturer, choose '''Generic'''; Model/Driver, select '''Generic postscript color printer''' or '''Generic Cups-PDF Printer'''. Alternatively, provide the PPD file from [http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/cups-pdf-CURRENT/extra/CUPS-PDF.ppd this link].

After installing the package, set it up as if it were for any other printer by using the web interface. For the Device, select '''CUPS-PDF (Virtual PDF Printer)'''; Make/Manufacturer, choose '''Generic'''; Model/Driver, select '''Generic postscript color printer''' or '''Generic Cups-PDF Printer'''. Alternatively, provide the PPD file from [http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/cups-pdf-CURRENT/extra/CUPS-PDF.ppd this link].

−

==== Print to postscript: CUPS-PDF virtual printer trick ====

+

==== Print to PostScript: CUPS-PDF virtual printer trick ====

−

Printing to PDF in most applications like OpenOffice is no problem; just hit the button. Yet when printing out to postscript, matters take a little more work. For applications like OpenOffice where printing to kprinter is nebulous at best, there has to be another way -- and there is. The CUPS-PDF (Virtual PDF Printer) actually creates a postscript file and then creates the PDF using the ps2pdf utility. To print to postscript, what needs to be done is capturing the intermediate postscript file created by CUPS-PDF. This is easily accomplished with by selecting the "print to file" option in the print dialog. (choose either .ps or .eps as the extension) After selecting the "print to file" checkbox simply enter the filename and click "print".

+

Printing to PDF in most applications like OpenOffice is no problem; just hit the button. Yet when printing out to postscript, matters take a little more work. For applications like OpenOffice where printing to kprinter is nebulous at best, there has to be another way&mdash;and there is. The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to postscript, what needs to be done is capturing the intermediate postscript file created by CUPS-PDF. This is easily accomplished with by selecting the "print to file" option in the print dialog. (choose either .ps or .eps as the extension) After selecting the "print to file" checkbox simply enter the file name and click "print".

Now to print to postscript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...

+

Now to print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...

Installing the client package

Then add your CUPS server's IP address or hostname into /etc/cups/client.conf. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.

Optional advanced network setup

It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.

Note: This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.
To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browserd (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers.

samsung-unified-driverAUR - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the AUR.

ufr2AUR or cndrvcups-lbAUR - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the AUR.

cups-pdf - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it

If you are not sure of what driver package to install or if the current driver is not working, it may be easiest to just install all of the drivers. Some of the package names are misleading because printers of other makes may rely on them. For example, the Brother HL-2140 needs the hplip driver installed.

Download printer PPD

Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the foomatic-filters, gimp-print and hplip packages already include quite a few PPD files which will automatically be detected by CUPS.

Here is an explanation of what a PPD file is from the Linux Printing website:

"For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc."

Configuring

Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. However, in order to make this process easy for the largest amount of users, this article will focus on the web interface provided by CUPS.

If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the CUPS printer sharing page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.

USB printers can get accessed with two methods: The usblp kernel module and libusb. The former is the classic way. It is simple: Data is sent to the printer by writing it to a device file as a simple serial data stream. Reading the same device file allows bi-di access, at least for things like reading out ink levels, status, or printer capability information (PJL). It works very well for simple printers, but for multi-function devices (printer/scanner) it is not suitable and manufacturers like HP supply their own backends. (source: here)

Kernel modules

Before using the CUPS web interface, the appropriate kernel modules need to be installed. The following steps are from the Gentoo Printing Guide.

This section may not be necessary, however, depending on which kernel is being used. The kernel module may load automatically after plugging in the printer. Use the tail command (described below) to see if the printer has already been detected. The lsmod utility can also be used to see what modules have been loaded.

USB printers

Warning: As of cups version 1.6.0, you no longer need to blacklist the usblp kernel module.

If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See upstream bug for more.

Some USB printer users may want to try if blacklisting the usblp module would help:

/etc/modprobe.d/blacklist.conf

blacklist usblp

Custom kernel users may need to manually load the usbcore module before proceeding:

# modprobe usbcore

Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:

# tail /var/log/messages.log

or

# dmesg

If you're using usblp, the output should indicate that the printer has been detected like so:

Parallel port printers

To use a parallel port printer the configuration is pretty much the same, except for the modules:

# modprobe lp
# modprobe parport
# modprobe parport_pc

Once again, check the setup by running:

# tail /var/log/messages.log

It should display something like this:

lp0: using parport0 (polling).

If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in /etc/cups/printers.conf:

DeviceID = parallel:/dev/usb/lp0

Auto-loading

It is convenient to have the system automatically load the kernel module every time it starts up. To do so, use a text editor to open up /etc/modules-load.d/printing.conf and add the appropriate modules one per line. Here is an example:

CUPS daemon

Web interface and tool-kit

Once the daemon is running, open a browser and go to: http://localhost:631 (The localhost string may need to be replaced with the hostname found in/etc/hosts).

From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on Adding Printers and Classes and then Add Printer. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to USB Printer #1 for USB printers). Finally, choose the appropriate drivers and the configuration is complete.

Now test the configuration by pressing the Maintenance drop-down menu then Print Test Page. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.

Note: When setting up a USB printer, you should see your printer listed on Add Printer page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize
your printer.

Note: To enable wireless scanning on certain HP multi-function devices using the hplip package, you may need to add the printer as a Network Printer using the http:// protocol. To determine the proper URI to use, run the hp-makeuri command.

CUPS administration

A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the sys group, or root (change this by editing /etc/cups/cupsd.conf in the line of SystemGroup).

If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username and password. In this case, follow these instructions on the CUPS FAQ. You might also want to read this post.

Remote access to web interface

By default, the CUPS web interface can only be accessed by the localhost; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the /etc/cups/cupsd.conf file. Replace the line:

This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.

Troubleshooting

The best way to get printing working is to set 'LogLevel' in /etc/cups/cupsd.conf to:

LogLevel debug

And then viewing the output from /var/log/cups/error_log like this:

# tail -n 100 -f /var/log/cups/error_log

The characters at the left of the output stand for:

D=Debug

E=Error

I=Information

And so on

These files may also prove useful:

/var/log/cups/page_log - Echoes a new entry each time a print is successful

/var/log/cups/access_log - Lists all cupsd http1.1 server activity

Of course, it is important to know how CUPS works if wanting to solve related issues:

An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).

CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.

GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.

Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.

Print a document and watch error_log to get a more detailed and correct image of the printing process.

Problems resulting from upgrades

Issues that appeared after CUPS and related program packages underwent a version increment

CUPS stops working

The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.

To use the new configuration, copy /etc/cups/cupsd.conf.default to /etc/cups/cupsd.conf (backup the old configuration if needed) and restart CUPS to employ the new settings.

All jobs are "stopped"

If all jobs sent to the printer become "stopped", delete the printer and add it again.
Using the CUPS web interface, go to Printers > Delete Printer.

To check the printer's settings go to Printers, then Modify Printer. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.

All jobs are "The printer is not responding"

On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.
If your printer's connection looks like this:

lpd://BRN_020554/BINARY_P1

then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS

The PPD version is not compatible with gutenprint

Run:

# /usr/sbin/cups-genppdupdate

And restart CUPS (as pointed out in gutenprint's post-install message)

Other

CUPS permission errors

Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:

smb://workgroup/username:password@hostname/printer_name

Sometimes, the block device has wrong permissions:

# ls /dev/usb/
lp0
# chgrp lp /dev/usb/lp0

HPLIP printer sends "/usr/lib/cups/backend/hp failed" error

Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.

Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with hp-makeuri.

HPLIP printer claims job is complete but printer does nothing

This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.

Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter

This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the usb-modeswitch and usb-modeswitch-data packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).

This can also occur with network attached printers if the avahi-daemon is not running.

CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer

If receiving any of the following error messages in /var/log/cups/error_log while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':

Filter "foomatic-rip" for printer "<printer_name>" not available: No such file or director

Unknown supported format: application/postscript

Comment the lines:

application/octet-stream application/vnd.cups-raw 0 -

from /etc/cups/mime.convs, and:

application/octet-stream

in /etc/cups/mime.types.

Finding URIs for Windows Print Servers

Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:

$ smbtree -U windowsusername

This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:

What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:

smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series

as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.
If it won't work try '%20' instead of spaces.

Print-Job client-error-document-format-not-supported

Try installing the foomatic packages and use a foomatic driver.

/usr/lib/cups/backend/hp failed

Change

SystemGroup sys root

to

SystemGroup lp root

in /etc/cups/cupsd.conf

Following steps 1-3 in the Alternative CUPS interfaces below may be a better solution, since newer versions of cups will not allow the same group for both normal and admin operation.

"Unable to get list of printer drivers"

Try to remove Foomatic drivers.

lp: Error - Scheduler Not Responding

If you get this error when printing a document using:

$ lp document-to-print

Try setting the CUPS_SERVER environment variable:

$ export CUPS_SERVER=localhost

If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.

CUPS prints only an empty and an error-message page on HP LaserJet

There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by Ubuntu.
The first page is empty, the second page contains the following error message:

PDF virtual printer

CUPS-PDF is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. Obviously this package is not necessary, but it can be quite useful.

Find generated PDF documents in a sub-directory located at /var/spool/cups-pdf. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit /etc/cups/cups-pdf.conf by changing the line

#Out /var/spool/cups-pdf/${USER}

to

Out /home/${USER}

This package can be installed by the following command:

# pacman -S cups-pdf

After installing the package, set it up as if it were for any other printer by using the web interface. For the Device, select CUPS-PDF (Virtual PDF Printer); Make/Manufacturer, choose Generic; Model/Driver, select Generic postscript color printer or Generic Cups-PDF Printer. Alternatively, provide the PPD file from this link.

Print to PostScript: CUPS-PDF virtual printer trick

Printing to PDF in most applications like OpenOffice is no problem; just hit the button. Yet when printing out to postscript, matters take a little more work. For applications like OpenOffice where printing to kprinter is nebulous at best, there has to be another way—and there is. The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to postscript, what needs to be done is capturing the intermediate postscript file created by CUPS-PDF. This is easily accomplished with by selecting the "print to file" option in the print dialog. (choose either .ps or .eps as the extension) After selecting the "print to file" checkbox simply enter the file name and click "print".

Now to print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...

Another source for printer drivers

Turboprint is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.