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.

−

==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.

Line 32:

Line 32:

* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.

* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.

−

==Installing the client package==

+

== Installing the client package ==

−

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'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.

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+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.

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.

{{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.

+

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

There is [https://bbs.archlinux.org/viewtopic.php?id&#61;161440 good news] in April 2013 (still has to be incorporated above).}}

There is [https://bbs.archlinux.org/viewtopic.php?id&#61;161440 good news] in April 2013 (still has to be incorporated above).}}

−

===Installing CUPS a 32 bit chroot environment===

+

=== Installing CUPS a 32 bit chroot environment ===

If you have a 64 bit base installation with a [[Install_bundled_32-bit_system_in_Arch64|32 bit chroot environment]], explicit installation of CUPS is not necessary in the 32 bit environment. To access installed CUPS printers from the chroot environment, one needs to bind the {{ic|/var/run/cups}} directory to the same relative location in the chroot environment. Simply create the directory in the chroot (it probably doesn't exist), mount (with {{ic|-o bind}} passed to the command}}, and printers should be available from 32 bit chroot applications immediately.

If you have a 64 bit base installation with a [[Install_bundled_32-bit_system_in_Arch64|32 bit chroot environment]], explicit installation of CUPS is not necessary in the 32 bit environment. To access installed CUPS printers from the chroot environment, one needs to bind the {{ic|/var/run/cups}} directory to the same relative location in the chroot environment. Simply create the directory in the chroot (it probably doesn't exist), mount (with {{ic|-o bind}} passed to the command}}, and printers should be available from 32 bit chroot applications immediately.

Line 52:

Line 54:

# mount -o bind /var/run/cups /path/to/chroot/var/run/cups}}

# mount -o bind /var/run/cups /path/to/chroot/var/run/cups}}

−

==Installing the server packages==

+

== Installing the server packages ==

−

The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[Official repositories]].

+

+

The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[official repositories]].

* {{Pkg|cups}} - the actual CUPS daemon

* {{Pkg|cups}} - the actual CUPS daemon

* {{Pkg|cups-filters}} - essential filters

* {{Pkg|cups-filters}} - essential filters

* {{Pkg|ghostscript}} - (optional) PostScript interpreter

* {{Pkg|ghostscript}} - (optional) PostScript interpreter

−

* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts

+

* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts

If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.

If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.

Line 64:

Line 67:

If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.

If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.

−

===Printer driver===

+

=== Printer driver ===

+

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:

Line 81:

Line 85:

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.

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====

+

==== 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.

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.

Line 94:

Line 99:

{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}

{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}

−

====Another source for printer drivers====

+

==== Another source for printer drivers ====

+

[http://www.turboprint.de/english.html 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.

[http://www.turboprint.de/english.html 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.

−

==Hardware support and configuration==

+

== Hardware support and configuration ==

−

===USB printers===

+

+

=== USB printers ===

+

{{Tip|Most USB printers should work out of the box, you can skip this section and come back if you can not get your printer to work.}}

{{Tip|Most USB printers should work out of the box, you can skip this section and come back if you can not get your printer to work.}}

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: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here].

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: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here].

−

====Blacklisting usblp====

+

==== Blacklisting usblp ====

−

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

+

+

{{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 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.}}

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.}}

If you have problems getting your USB printer to work, you can try blacklisting the {{ic|usblp}} [[kernel module]]:

If you have problems getting your USB printer to work, you can try blacklisting the {{ic|usblp}} [[kernel module]]:

To use a parallel port printer, you will need to load the {{ic|lp}}, {{ic|parport}} and {{ic|parport_pc}} [[kernel modules]].

To use a parallel port printer, you will need to load the {{ic|lp}}, {{ic|parport}} and {{ic|parport_pc}} [[kernel modules]].

Line 140:

Line 153:

=== HP Printer ===

=== HP Printer ===

+

HP printers can also be installed via HP's Linux setup tool. Install it by installing {{Pkg|hplip}} from the [[official repositories]].

HP printers can also be installed via HP's Linux setup tool. Install it by installing {{Pkg|hplip}} from the [[official repositories]].

Line 149:

Line 163:

PPD files are in {{ic|/usr/share/ppd/HP/}}.

PPD files are in {{ic|/usr/share/ppd/HP/}}.

+

+

{{Note| If you get a syntax error during installation, it is likely because {{ic|/usr/bin/python}} is symlinked to {{ic|/usr/bin/python3}}. ''Temporarily'' relink {{ic|/usr/bin/python}} to {{ic|/usr/bin/python2}}. Ensure you revert it back after setup !

+

If you get errors complaining about missing gobject/dbus dependencies, install {{Pkg|python2-gobject2}} and {{Pkg|python2-dbus}}. For details see this [https://bugs.archlinux.org/task/26666 bug report].

+

}}

For printers that require the proprietary HP plugin (like the Laserjet Pro P1102w), install the {{AUR|hplip-plugin}} package from [[AUR]].

For printers that require the proprietary HP plugin (like the Laserjet Pro P1102w), install the {{AUR|hplip-plugin}} package from [[AUR]].

−

==Configuring==

+

{{Note|

+

{{Pkg|hplip}} depends on {{Pkg|foomatic-db-engine}} which prevents the drivers list from appearing when a printer is added to CUPS via the web user interface (following error : "Unable to get list of printer drivers"). The workaround consists of installing {{Pkg|hplip}} first, retrieving the corresponding PPD file from {{ic|/usr/share/ppd/HP/}}, then, removing {{Pkg|hplip}} entirely and the unnecessary dependencies. Finally, install the printer manually using the CUPS web ui, select the PPD file you retrieved then re-install {{Pkg|hplip}}. After a reboot, you should have a fully working printer.}}

+

+

== 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. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.

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. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.

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.

−

===CUPS daemon===

+

=== CUPS daemon ===

−

With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]].

+

+

With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]], and enable them as required.

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

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

Line 168:

Line 191:

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 front-ends.}}

+

{{Tip|See: [[#Alternative CUPS interfaces]] for 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|

−

your printer.}}

+

* 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.

−

+

* 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.}}

−

{{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 ====

Line 180:

Line 202:

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 (root) and password. Follow the instructions above to add other users as cups administrators.

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 (root) and password. Follow the instructions above to add other users as cups administrators.

−

====Remote access to web interface====

+

==== 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 {{ic|/etc/cups/cupsd.conf}} file. Replace the line:

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 {{ic|/etc/cups/cupsd.conf}} file. Replace the line:

Listen localhost:631

Listen localhost:631

Line 232:

Line 255:

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

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

−

===Command-line configuration===

+

=== Command-line configuration ===

CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.

CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.

Line 246:

Line 269:

;Add a new printer

;Add a new printer

−

# lpadmin -p <printer> -E -v <device> -P <ppd>

+

# lpadmin -p ''printer'' -E -v ''device'' -P ''ppd''

−

The <printer> is up to you. The device can be retrieved from the 'lpinfo -i' command.

+

The ''printer'' is up to you. The device can be retrieved from the 'lpinfo -i' command.

In the following, the <printer> references the name you have used here to set up the printer.

+

In the following, the ''printer'' references the name you have used here to set up the printer.

;Set the default printer

;Set the default printer

−

$ lpoptions -d <printer>

+

$ lpoptions -d ''printer''

;Check the status

;Check the status

$ lpstat -s

$ lpstat -s

−

$ lpstat -p <printer>

+

$ lpstat -p ''printer''

;Deactivate a printer

;Deactivate a printer

−

# cupsdisable <printer>

+

# cupsdisable ''printer''

;Activate a printer

;Activate a printer

−

# cupsenable <printer>

+

# cupsenable ''printer''

;Remove a printer

;Remove a printer

First set it to reject all incoming entries:

First set it to reject all incoming entries:

−

# cupsreject <printer>

+

# cupsreject ''printer''

Then disable it.

Then disable it.

−

# cupsdisable <printer>

+

# cupsdisable ''printer''

Finally remove it.

Finally remove it.

−

# lpadmin -x <printer>

+

# lpadmin -x ''printer''

;Print a file

;Print a file

−

$ lpr <file>

+

$ lpr ''file''

−

$ lpr -# 17 <file> # print the file 17 times

+

$ lpr -# 17 ''file'' # print the file 17 times

$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.

$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.

Line 288:

Line 311:

# lprm - # remove all entries

# lprm - # remove all entries

−

===Alternative CUPS interfaces===

+

=== Alternative CUPS interfaces ===

−

====GNOME====

−

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

−

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''').

+

==== GNOME ====

+

+

You can configure and manage printers by [[pacman|installing]] {{Pkg|system-config-printer}}. This program does pull in some gnome dependencies.

+

+

If your user does not have sufficient priviliges to administer the cups scheduler, system-config-printer will request the root password when it starts. You can avoid this by performing the following instructions.

+

+

1. Create a group for administering the cups scheduler:

−

1. Create group, and add a user to it

# groupadd lpadmin

# groupadd lpadmin

−

# usermod -aG lpadmin <username>

−

2. Add {{ic|lpadmin}} to this line in {{ic|/etc/cups/cups-files.conf}}

+

2. Add yourself to the newly created group:

−

SystemGroup sys root <insert here>

+

+

# usermod -aG lpadmin ''username''

+

+

3. Tell cups to respect the newly created group:

−

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

+

{{hc|/etc/cups/cups-files.conf|

+

...

+

SystemGroup sys root '''lpadmin'''

+

...}}

+

+

4. Restart cups:

+

+

# systemctl restart cupsd

+

+

5. Log out and log in again or restart your computer.

+

+

==== KDE ====

−

====KDE====

[[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.

−

====Other====

+

==== Other ====

+

There is also {{AUR|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. This package is not necessary, but it can be quite useful. It can be installed using the following command:

+

−

# pacman -S cups-pdf

+

{{Pkg|cups-pdf}} is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. This package is not necessary, but it can be quite useful.

After installing the package, set it up as if it were for any other printer by using the web interface. Access the cups print manager: http://localhost:631 and select:

After installing the package, set it up as if it were for any other printer by using the web interface. Access the cups print manager: http://localhost:631 and select:

Line 327:

Line 366:

=== Print to PostScript ===

=== Print to PostScript ===

+

The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. 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...

The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. 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...

−

==Troubleshooting==

+

== Troubleshooting ==

+

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

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

LogLevel debug

LogLevel debug

Line 354:

Line 395:

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

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

−

===Problems resulting from upgrades===

+

=== Problems resulting from upgrades ===

+

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

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

−

====CUPS stops working====

+

==== 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.

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 {{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.

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.

−

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

+

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

+

If all jobs sent to the printer become "stopped", delete the printer and add it again.

If all jobs sent to the printer become "stopped", delete the printer and add it again.

"hp-check -t" won't give you useful information to find the required package. You have to install all the "Dependent Packages" prefixed with "python2" in https://www.archlinux.org/packages/extra/x86_64/hplip/

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

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

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).

−

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

+

This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running. Another possiblility is the specification of the printer's IP address in hp-setup fails to locate the printer because the IP address of the the printer changed due to DHCP.

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

If receiving any of the following error messages in {{ic|/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':

If receiving any of the following error messages in {{ic|/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

+

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

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 {{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.

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.

−

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

+

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

+

If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:

If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:

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:

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:

Line 464:

Line 529:

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

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 ====

+

Try installing the foomatic packages and use a foomatic driver.

Try installing the foomatic packages and use a foomatic driver.

−

====/usr/lib/cups/backend/hp failed====

+

==== /usr/lib/cups/backend/hp failed ====

−

Change

+

+

Change:

SystemGroup sys root

SystemGroup sys root

−

to

+

to:

SystemGroup lp root

SystemGroup lp root

in {{ic|/etc/cups/cupsd.conf}}

in {{ic|/etc/cups/cupsd.conf}}

Line 478:

Line 545:

==== Unable to get list of printer drivers ====

==== Unable to get list of printer drivers ====

+

* Check your ServerName in /etc/cups/client.conf is written without http://

* Check your ServerName in /etc/cups/client.conf is written without http://

ServerName localhost:631

ServerName localhost:631

−

* Try to remove Foomatic drivers.

+

* Try to remove Foomatic drivers or refer to [[#HP_Printer]] for a workaround.

+

+

==== lp: Error - Scheduler Not Responding ====

−

====lp: Error - Scheduler Not Responding====

If you get this error when printing a document using:

If you get this error when printing a document using:

Line 493:

Line 562:

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.

−

====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 ====

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 [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].

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 [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].

====HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not====

+

==== HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not ====

The issue might have to do with the file permission change that had been made to {{ic|/var/lib/hp/hplip.state}}. To correct the issue, a simple {{ic|chmod 644 /var/lib/hp/hplip.state}} and {{ic|chmod 755 /var/lib/hp}} should be sufficient. For further information, please read this [https://bugs.launchpad.net/hplip/+bug/1131596 link].

The issue might have to do with the file permission change that had been made to {{ic|/var/lib/hp/hplip.state}}. To correct the issue, a simple {{ic|chmod 644 /var/lib/hp/hplip.state}} and {{ic|chmod 755 /var/lib/hp}} should be sufficient. For further information, please read this [https://bugs.launchpad.net/hplip/+bug/1131596 link].

−

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

+

==== 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]):

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]):

−

# Remove {{ic|usblp}} from blacklist

+

* Remove {{ic|usblp}} from blacklist

−

# Load {{ic|usblp}} module

+

* Load {{ic|usblp}} module

modprobe usblp

modprobe usblp

−

# Stop cups (sudo systemctl stop cups)

+

* Stop cups

−

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

+

* Add the following udev rule in a new rule file:

−

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

+

{{hc|/etc/udev/rules.d/10-cups_device_link.rules|2=

−

# Reload udev rules

+

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

−

sudo udevadm control --reload-rules

+

}}

−

# Unplug and re-plug the printer

+

* Reload udev rules:

−

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

+

# udevadm control --reload-rules

+

* Unplug and re-plug the printer.

+

* Wait a few seconds and then start cups again.

−

====Can't load /etc/samba/smb.conf====

+

==== Can't load /etc/samba/smb.conf ====

If you're printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty smb.conf:

If you're printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty smb.conf:

Line 562:

Line 636:

# touch /etc/samba/smb.conf

# touch /etc/samba/smb.conf

−

and restart cupsd:

+

and restart cupsd.

−

−

# systemctl restart cupsd

−

−

====CUPS' systemd service does not start even though it's enabled====

+

==== CUPS' systemd service does not start even though it's enabled ====

The systemd .service file provided by CUPS uses socket activation, meaning the service is only started when an

The systemd .service file provided by CUPS uses socket activation, meaning the service is only started when an

Line 576:

Line 647:

{{hc|/etc/systemd/system/cups.socket|

{{hc|/etc/systemd/system/cups.socket|

−

.include /lib/systemd/system/cups.socket

+

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

[Socket]

[Socket]

Line 603:

Line 674:

CUPS should now start automatically when printing locally or over the network.

CUPS should now start automatically when printing locally or over the network.

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-browsed (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers.

There is good news in April 2013 (still has to be incorporated above).

Installing CUPS a 32 bit chroot environment

If you have a 64 bit base installation with a 32 bit chroot environment, explicit installation of CUPS is not necessary in the 32 bit environment. To access installed CUPS printers from the chroot environment, one needs to bind the /var/run/cups directory to the same relative location in the chroot environment. Simply create the directory in the chroot (it probably doesn't exist), mount (with -o bind passed to the command}}, and printers should be available from 32 bit chroot applications immediately.

foo2zjsAUR - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info here. Package is available in the AUR.

hpojAUR - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in this thread. Package is available in the AUR.

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."

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.

Hardware support and configuration

USB printers

Tip: Most USB printers should work out of the box, you can skip this section and come back if you can not get your printer to work.

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.

Blacklisting usblp

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.

If you have problems getting your USB printer to work, you can try blacklisting the usblpkernel module:

/etc/modprobe.d/blacklistusblp.conf

blacklist usblp

Custom kernel users may need to manually load the usbcorekernel module before proceeding.

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, you will need to load the lp, parport and parport_pckernel modules.

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:

Note: If you get a syntax error during installation, it is likely because /usr/bin/python is symlinked to /usr/bin/python3. Temporarily relink /usr/bin/python to /usr/bin/python2. Ensure you revert it back after setup !

For printers that require the proprietary HP plugin (like the Laserjet Pro P1102w), install the hplip-pluginAUR package from AUR.

Note: hplip depends on foomatic-db-engine which prevents the drivers list from appearing when a printer is added to CUPS via the web user interface (following error : "Unable to get list of printer drivers"). The workaround consists of installing hplip first, retrieving the corresponding PPD file from /usr/share/ppd/HP/, then, removing hplip entirely and the unnecessary dependencies. Finally, install the printer manually using the CUPS web ui, select the PPD file you retrieved then re-install hplip. After a reboot, you should have a fully working printer.

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. CUPS also embeds a full-featured web interface. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. Depending on your needs, you may choose one method or the other.

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.

CUPS daemon

With the kernel modules installed, you can now start the cups and optionally, the cups-browseddaemons, and enable them as required.

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/hostname).

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.

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.

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. Other admin groups (e.g. lpadmin or printadmin) may be added to the SystemGroup line in /etc/cups/cups-files.conf (you might have to add this line). See these instructions at cups.org. You might also want to read this post. Create the group[s] (man groupadd) and add the group[s] to users (man usermod). cupsd must be restarted and the user must re-login for these changes to take affect.

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 (root) and password. Follow the instructions above to add other users as cups administrators.

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:

Alternative CUPS interfaces

GNOME

If your user does not have sufficient priviliges to administer the cups scheduler, system-config-printer will request the root password when it starts. You can avoid this by performing the following instructions.

1. Create a group for administering the cups scheduler:

# groupadd lpadmin

2. Add yourself to the newly created group:

# usermod -aG lpadmin username

3. Tell cups to respect the newly created group:

/etc/cups/cups-files.conf

...
SystemGroup sys root lpadmin
...

4. Restart cups:

# systemctl restart cupsd

5. Log out and log in again or restart your computer.

KDE

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.

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}

Print to PostScript

The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. 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...

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/bin/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. Another possiblility is the specification of the printer's IP address in hp-setup fails to locate the printer because the IP address of the the printer changed due to DHCP.

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

Print button greyed-out in GNOME print dialogs

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

Check your ServerName in /etc/cups/client.conf is written without http://

ServerName localhost:631

Try to remove Foomatic drivers or refer to #HP_Printer for a workaround.

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:

HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not

The issue might have to do with the file permission change that had been made to /var/lib/hp/hplip.state. To correct the issue, a simple chmod 644 /var/lib/hp/hplip.state and chmod 755 /var/lib/hp should be sufficient. For further information, please read this link.

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 this thread):

Remove usblp from blacklist

Load usblp module

modprobe usblp

Stop cups

Add the following udev rule in a new rule file:

/etc/udev/rules.d/10-cups_device_link.rules

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

Reload udev rules:

# udevadm control --reload-rules

Unplug and re-plug the printer.

Wait a few seconds and then start cups again.

Can't load /etc/samba/smb.conf

If you're printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty smb.conf:

# mkdir /etc/samba
# touch /etc/samba/smb.conf

and restart cupsd.

CUPS' systemd service does not start even though it's enabled

The systemd .service file provided by CUPS uses socket activation, meaning the service is only started when an
application connects to CUPS' socket. However, the systemd .socket file provided by cups only works for the local
/var/run/cups/cups.sock socket.

In order to have cupsd start when initiating a print job over the network, create the following file: