https://wiki.archlinux.org/api.php?action=feedcontributions&user=Excruciated&feedformat=atomArchWiki - User contributions [en]2024-03-29T15:39:34ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=CUPS&diff=251498CUPS2013-03-20T23:10:23Z<p>Excruciated: /* HP Printer */ package was misnamed</p>
<hr />
<div>[[Category:Printers]]<br />
[[cs:CUPS]]<br />
[[es:CUPS]]<br />
[[fr:CUPS]]<br />
[[it:CUPS]]<br />
[[pl:CUPS]]<br />
[[ru:CUPS]]<br />
[[th:CUPS]]<br />
[[tr:CUPS]]<br />
[[zh-CN:CUPS]]<br />
[[zh-TW:CUPS]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".<br />
<br />
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.<br />
<br />
==CUPS Linux Printing workflow==<br />
As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For<br />
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.<br />
A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].<br />
<br />
There are two ways to setup a printer.<br />
* If there's a CUPS server running in your network and sharing a printer you only need to install the client package.<br />
* If the printer is connected directly to your system or you have access to an IPP network printer then setup a local CUPS server.<br />
<br />
==Installing the client package==<br />
The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[Official repositories]].<br />
<br />
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.<br />
<br />
===Optional advanced network setup===<br />
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.<br />
{{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.<br />
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.}}<br />
<br />
==Installing the server packages==<br />
The following packages and some printer drivers are needed. [[pacman|Install]] them from the [[Official repositories]].<br />
<br />
* {{Pkg|cups}} - the actual CUPS daemon<br />
* {{Pkg|cups-filters}} - essential filters<br />
* {{Pkg|ghostscript}} - (optional) PostScript interpreter<br />
* {{Pkg|gsfonts}} - GhostScript standard Type1 fonts<br />
<br />
# pacman -S cups cups-filters ghostscript gsfonts<br />
<br />
If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure '''avahi-daemon''' is started before '''cupsd'''.<br />
<br />
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}}.<br />
<br />
===Printer driver===<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''{{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]]<br />
* '''{{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!".<br />
* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''{{Pkg|splix}}''' - Samsung drivers for SPL (Samsung Printer Language) printers.<br />
<br />
* '''{{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]].<br />
* '''{{AUR|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]. Package is available in the [[AUR]].<br />
* '''{{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]].<br />
* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
<br />
* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
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.<br />
<br />
====Download printer PPD====<br />
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.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''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.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
====Another source for printer drivers====<br />
[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.<br />
<br />
==Hardware support and configuration==<br />
<br />
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].<br />
<br />
===Kernel modules===<br />
Before using the CUPS web interface, the appropriate kernel modules need to be installed. The following steps are from the Gentoo Printing Guide.<br />
<br />
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 {{ic|tail}} command (described below) to see if the printer has already been detected. The {{ic|lsmod}} utility can also be used to see what modules have been loaded.<br />
<br />
====USB printers====<br />
{{Warning|As of {{pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.}}<br />
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.<br />
<br />
Some USB printer users may want to try if blacklisting the {{ic|usblp}} module would help:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|blacklist usblp}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} module before proceeding:<br />
# modprobe usbcore<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
====Parallel port printers====<br />
To use a parallel port printer the configuration is pretty much the same, except for the modules:<br />
# modprobe lp<br />
# modprobe parport<br />
# modprobe parport_pc<br />
<br />
Once again, check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
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}}:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
====Auto-loading====<br />
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:<br />
lp<br />
parport<br />
parport_pc<br />
<br />
=== HP Printer ===<br />
HP printers can also be installed via HP's linux setup tool. If you want to run the setup tool, ensure you have {{ic|python2-qt}} and {{ic|pygobject}}.<br />
<br />
To run with qt frontend :<br />
{{bc|<nowiki><br />
# hp-setup -u<br />
</nowiki>}}<br />
<br />
To run with command line : <br />
{{bc|<nowiki><br />
# hp-setup -i<br />
</nowiki>}}<br />
PPD files are in {{ic|/usr/share/ppd/HP/}}.<br />
<br />
For printers that require the proprietary HP plugin (like the P1102w), install the {{AUR|hplip-plugin}} package from [[AUR]].<br />
<br />
==Configuring==<br />
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.<br />
<br />
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.<br />
<br />
===CUPS daemon===<br />
With the kernel modules installed, you can now start the '''cups''' and optionally, the '''cups-browsed''' [[daemons]].<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
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/hostname}}).<br />
<br />
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.<br />
<br />
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.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}<br />
{{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 <br />
your printer.}}<br />
<br />
{{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.}}<br />
<br />
==== CUPS administration ====<br />
<br />
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}}). <br />
<br />
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].<br />
<br />
====Remote access to web interface====<br />
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:<br />
Listen localhost:631<br />
with<br />
Port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow from all<br />
Allow from host.domain.com<br />
Allow from *.domain.com<br />
Allow from ip-address<br />
Allow from ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
===Command-line configuration===<br />
<br />
CUPS can be fully controlled from command-line with nice tools, ''i.e.'' the lp* and the cups* command families.<br />
<br />
On Arch Linux, most commands support auto-completion with common shells.<br />
Also note that command-line switches cannot be grouped.<br />
<br />
;List the devices<br />
# lpinfo -v<br />
<br />
;List the drivers<br />
# lpinfo -m<br />
<br />
;Add a new printer<br />
# lpadmin -p <printer> -E -v <device> -P <ppd><br />
<br />
The <printer> is up to you. The device can be retrieved from the 'lpinfo -i' command.<br />
Example:<br />
# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -P /usr/share/ppd/HP/hp-deskjet_940c.ppd.gz<br />
<br />
In the following, the <printer> references the name you have used here to set up the printer.<br />
<br />
;Set the default printer<br />
$ lpoptions -d <printer><br />
<br />
;Check the status<br />
$ lpstat -s<br />
$ lpstat -p <printer><br />
<br />
;Deactivate a printer<br />
# cupsdisable <printer><br />
<br />
;Activate a printer<br />
# cupsenable <printer><br />
<br />
;Remove a printer<br />
First set it to reject all incoming entries:<br />
# cupsreject <printer><br />
Then disable it.<br />
# cupsdisable <printer><br />
Finally remove it.<br />
# lpadmin -x <printer><br />
<br />
;Print a file<br />
$ lpr <file><br />
$ lpr -# 17 <file> # print the file 17 times<br />
$ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.<br />
<br />
;Check the printing queue<br />
$ lpq<br />
$ lpq -a # on all printers<br />
<br />
;Clear the printing queue<br />
# lprm # remove last entry only<br />
# lprm - # remove all entries<br />
<br />
===GNOME CUPS interface===<br />
If using [[GNOME]], a possibility is to manage and configure the printer by [[pacman|installing]] {{Pkg|system-config-printer}}.<br />
<br />
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''')<br />
<br />
* 1. Create group, and add a user to it<br />
# groupadd lpadmin<br />
# usermod -aG lpadmin <username><br />
<br />
* 2. Add "lpadmin" (without the quotes) to this line in {{ic|/etc/cups/cupsd.conf}}<br />
SystemGroup sys root <insert here><br />
<br />
* 3. Restart cups, log out and in again (or restart computer)<br />
{{bc|# systemctl restart cups}}<br />
<br />
[[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.<br />
<br />
There is also {{AUR|gtklp}} in the [[AUR]].<br />
<br />
==PDF virtual printer==<br />
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:<br />
# pacman -S cups-pdf<br />
<br />
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:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
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<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out ${HOME}<br />
<br />
=== Print to PostScript ===<br />
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...<br />
<br />
==Troubleshooting==<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# 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).<br />
# 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.<br />
# 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.<br />
# 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.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
===Problems resulting from upgrades===<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
====CUPS stops working====<br />
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.<br />
<br />
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.<br />
<br />
====All jobs are "stopped"====<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
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.<br />
<br />
====All jobs are "The printer is not responding"====<br />
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.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
====The PPD version is not compatible with gutenprint====<br />
Run:<br />
# /usr/sbin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
===Other===<br />
<br />
=====CUPS permission errors=====<br />
*Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
*Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
====HPLIP printer sends "/usr/lib/cups/backend/hp failed" error====<br />
Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.<br />
<br />
Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.<br />
<br />
{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}<br />
<br />
====HPLIP printer claims job is complete but printer does nothing====<br />
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.<br />
<br />
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.<br />
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter<br />
hp-firmware -n<br />
<br />
====hp-toolbox sends an error, "Unable to communicate with device"====<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/<printer id><br />
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]].<br />
<br />
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).<br />
<br />
This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running.<br />
<br />
====CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer====<br />
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':<br />
Filter "foomatic-rip" for printer "<printer_name>" not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
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.<br />
<br />
====Printing fails with unauthorised error====<br />
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:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
====Print button greyed-out in GNOME print dialogs====<br />
:''<small>Source: [https://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add<br />
# HostNameLookups Double<br />
<br />
Restart CUPS:<br />
# systemctl restart cups<br />
<br />
====Unknown supported format: application/postscript====<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
====Finding URIs for Windows Print Servers====<br />
<br />
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:<br />
$ smbtree -U ''windowsusername''<br />
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:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
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:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
If it won't work try '%20' instead of spaces.<br />
<br />
====Print-Job client-error-document-format-not-supported====<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
====/usr/lib/cups/backend/hp failed====<br />
Change<br />
SystemGroup sys root<br />
to<br />
SystemGroup lp root<br />
in {{ic|/etc/cups/cupsd.conf}}<br />
<br />
<br />
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.<br />
<br />
==== Unable to get list of printer drivers ====<br />
* Check your ServerName in /etc/cups/client.conf is written without http://<br />
ServerName localhost:631<br />
* Try to remove Foomatic drivers.<br />
<br />
====lp: Error - Scheduler Not Responding====<br />
If you get this error when printing a document using:<br />
<br />
$ lp document-to-print<br />
<br />
Try setting the CUPS_SERVER environment variable:<br />
<br />
$ export CUPS_SERVER=localhost<br />
<br />
If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.<br />
<br />
====CUPS prints only an empty and an error-message page on HP LaserJet====<br />
<br />
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].<br />
The first page is empty, the second page contains the following error message:<br />
ERROR:<br />
invalidaccess<br />
OFFENDING COMMAND:<br />
filter<br />
STACK:<br />
/SubFileDecode<br />
endstream<br />
...<br />
<br />
In order to fix the issue, use the following command (as superuser):<br />
lpadmin -p <printer> -o pdftops-renderer-default=pdftops<br />
<br />
===="Using invalid Host" error message====<br />
<br />
Try to add "ServerAlias *" into cupsd.conf<br />
<br />
====Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer)====<br />
<br />
Change the permissions of the printer USB port:<br />
<br />
Get the bus and device number from lsusb, then set the permission using:<br />
<br />
{{ic|chmod 0666 /dev/bus/usb/<bus number>/<device number>}}<br />
<br />
To make the persistent permission change that will be triggered automatically each time the computer is rebooted, add the following line.<br />
<br />
{{hc|/etc/udev/rules.d/10-local.rules|<nowiki>SUBSYSTEM=="usb", ATTRS{idVendor}=="Printer_idVendor", ATTRS{idProduct}=="Printer_idProduct", GROUP="lp", MODE:="666"</nowiki>}}<br />
<br />
Obtain the right information by using {{ic|lsusb}} command, and don't forget to substitute {{ic|Printer_idVendor}} & {{ic|Printer_idProduct}} with the relevant ones.<br />
<br />
Each system may vary, so consult [[udev#List_attributes_of_a_device]] wiki page.<br />
<br />
====HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not====<br />
<br />
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].<br />
<br />
====Printer is not recognized by CUPS====<br />
<br />
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]):<br />
<br />
# Remove {{ic|usblp}} from blacklist<br />
# Load {{ic|usblp}} module<br />
modprobe usblp<br />
# Stop cups (sudo systemctl stop cups)<br />
# Add the following udev rule in the following new rule /etc/udev/rules.d/10-cups_device_link.rules<br />
KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"<br />
# Reload udev rules<br />
sudo udevadm control --reload-rules<br />
# Unplug and re-plug the printer <br />
# Wait a few seconds and then start cups again (sudo systemctl start cups)<br />
<br />
==See also==<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS Website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's Printing Guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation Resources]''<br />
* [https://bbs.archlinux.org/ Arch Linux User Forums]<br />
* [http://wiki.gotux.net/tutorials/software/hp-printer Install HP Printers Easy Way]</div>Excruciated