CUPS
From ArchWiki
i18n |
---|
English |
Рolski |
Русский |
Türkçe |
The Common Unix Printing System
- "CUPS is the standards-based, open source printing system developed by Apple Inc. for Mac OS® X and other UNIX®-like operating systems."[1]
Although there are other printing packages such as LPRNG, CUPS is the most popular choice because of its relative ease of use. As a result, it is the default printing system on Arch Linux as well as many other GNU/Linux distributions.
Installing CUPS
You will need these packages:
# pacman -S cups ghostscript gsfonts
- cups - The actual CUPS software
- dbus-core - The dbus library is needed for CUPS (installed as a dependency)
- ghostscript - An interpreter for the Postscript language
- gsfonts - GhostScript standard Type1 fonts
- hal-cups-utils - read here http://bbs.archlinux.org/viewtopic.php?pid=655391#p655391
Here are some of the driver packages. Choosing the right driver depends on the printer you own:
- 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
- foomatic-db, foomatic-db-engine, foomatic-db-nonfree and foomatic-filters - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve your problems if the cups error_log is reporting "stopped with status 22!".
- hplip - HP GNU/Linux inkjet driver. Provides support for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models
- splix - Samsung drivers for SPL (Samsung Printer Language) printers
- ufr2 - 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 unsure of what driver package to install or your current driver is not working, it may be easiest to just install all of them, since some of the driver packages are misleading because printers of other makes may rely on them. For instance, the Brother HL-2140 needs the hplip driver installed.
# pacman -S gutenprint foomatic-db foomatic-db-engine foomatic-db-nonfree foomatic-filters hplip splix ufr2 cups-pdf
If your system is connected to a networked printer using the samba protocol or if the system is to be a print server for Windows clients, install Samba:
# pacman -S samba
Download Printer PPD
Depending on your 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."
If the PPD for your printer is not already in CUPS, you can:
- check AUR to see if there are packages for your printer/manufacturer
- visit http://www.linuxprinting.org/printer_list.cgi and select the manufacturer and model of your printer
- visit the website of your manufacturer and search for GNU/Linux drivers
Configuring CUPS
Now that you have CUPS installed, you have a variety of options on how to setup printing solutions. You can always use the tried and true command line. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help you manage your 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.
Please note that if you are planning on connecting to a network printer, rather than one that is directly connected to your computer, you may wish to read the #Printer Sharing section 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.
Kernel Modules
Before you can use 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 you are using. The kernel module may load automatically after plugging in your printer. Use the tail command (described below) to see if your printer has already been detected. You can also use lsmod to see what modules have been loaded.
USB Printers
If you want to use a USB printer, you may need to blacklist the "usblp" module in your rc.conf file:
MODULES=(... !usblp ...)
Note, there seems to be a lot of uncertainty regarding blacklisting usblp. My USB printers where not recognized without usblp.
Note, this assumes that you are using the stock kernels from Arch Linux. With a custom kernel, you may need to run this first:
# modprobe usbcore
Once the modules are installed, you should plug in your printer and check if the kernel detected it by running the following:
# tail /var/log/messages.log
or
# dmesg
You should see something like this:
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920 Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver
Parallel Port Printers
If you plan on using a parallel port printer, the configuration is pretty much the same. To manually load the modules:
# modprobe lp # modprobe parport # modprobe parport_pc
Once again, you can check your setup by running:
# tail /var/log/messages.log
You should see something like this:
lp0: using parport0 (polling).
Auto-loading
You may also want to have the system automatically load the kernel module every time the it starts up. To do so, use your favorite text editor to open up /etc/rc.conf and add the appropriate module to the MODULES=()
line. Here is an example:
MODULES=(!usbserial scsi_mod sd_mod snd-ymfpci snd-pcm-oss lp parport parport_pc ide-scsi)
CUPS Daemon
With the kernel modules installed, you are now ready to start the actual CUPS daemon. To do this, simply run this command:
# /etc/rc.d/cups start
If you want to have CUPS start up automatically every time you start your computer, then you need to add it to your DAEMONS=()
line in the /etc/rc.conf file. For example:
DAEMONS=(pcmcia syslogd klogd !fam esd mono network autofs cups crond gdm)
Web Interface and Tool-kit
Once the daemon is running, open a browser and go to: http://localhost:631 (you may need to replace localhost with the hostname found in /etc/hosts).
From here, all you have to do is follow the various wizards to add your printer. A usual procedure is to start by clicking on Manage Printers, and then Add Printer. When prompted for a user-name and password, log in as root. The name you assign to the printer does not matter, the same applies for 'location' and 'description'. Next you will be presented with a list of devices to select from. The actual name of the printer shows up next to the label ( e.g., next to USB Printer #1 for USB printers). Finally, chose the appropriate drivers and the configuration is complete.
Now, you can test your configuration by pressing the 'Print Test Page' button. If it does not print and you are sure the settings are correct, it is most likely you need to install a proper printer driver.
CUPS Administration
A user-name and password will be required when you administrate the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default user-name is the one assigned in the sys group, or root (you can change this by editing /etc/cups/cupsd.conf in the line of SystemGroup).
If the root account has been locked, you cannot log in the CUPS administration interface with the default user-name and passwd. In this case, you may need to change the default SystemGroup in cupsd.conf and 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:
Listen localhost:631
with
port 631
so that CUPS listens to incoming requests.
There are three levels of access that can be granted:
<Location /> #access to the server <Location /admin> #access to the admin pages <Location /admin/conf> #access to configuration files
To give remote hosts access to one of these levels, add an Allow statement to that level's section. An Allow statement can take one or more of the forms listed below:
Allow all Allow host.domain.com Allow *.domain.com Allow ip-address Allow ip-address/netmask
Deny statements can also be used. For example, if you wanted to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file /etc/cups/cupsd.conf would include this:
# Restrict access to the server... # By default only localhost connections are possible <Location /> Order allow,deny Allow From localhost Allow From 192.168.1.0/255.255.255.0 </Location> # Restrict access to the admin pages... <Location /admin> # Encryption disabled by default #Encryption Required Order allow,deny Allow From localhost Allow From 192.168.1.0/255.255.255.0 </Location> # Restrict access to configuration files... <Location /admin/conf> AuthType Basic Require user @SYSTEM Order allow,deny Allow From localhost Allow From 192.168.1.0/255.255.255.0 </Location>
Printer Sharing
Between GNU/Linux Systems
Once you have CUPS setup on your GNU/Linux print server, sharing the printer with another GNU/Linux system is relatively easy. While there are several ways to configure such a scenario, this section will cover the manual setup.
On the server computer (the one directly connected to the printer) simply open up /etc/cups/cupsd.conf and allow access to the server by modifying the location lines. For instance:
<Location /> Order allow,deny Allow localhost Allow 192.168.0.* </Location>
You will also need to make sure the server is listening on the IP address your client will be addressing. Add the following line after "# Listen <yourserverip>:631" (using your server's IP address instead of client's 192.168.0.100):
Listen 192.168.0.101:631
To "Show shared printers on the local network", add the line "BrowseAllow all":
Browsing On BrowseOrder allow,deny BrowseAllow @LOCAL BrowseAllow all
After you make your modifications, restart CUPS by:
# /etc/rc.d/cups restart
On the client system, open up (create if not present) /etc/cups/client.conf and add the ServerName to match the IP address or the name of your server. Add this line:
ServerName 192.168.0.101
To string "Show shared printers on the local network", add the line "BrowseAllow all":
Browsing On BrowseOrder allow,deny BrowseAllow @LOCAL BrowseAllow all
There are more configuration possibilities, including automatic methods, which are described in detail in http://localhost:631/help/network.html
After making modifications, restart CUPS.
Between GNU/Linux and Windows
GNU/Linux Client
If you are connected to a Windows print server (or any other Samba capable print server), you can skip the section about kernel modules and such. All you have to do is start the CUPS daemon and complete the web interface as specified previously. Before this, you need to activate the Samba CUPS back-end. You can do this by entering the following command:
# ln -s `which smbspool` /usr/lib/cups/backend/smb
After this, you will have to restart CUPS issuing the command specified in the previous section. Next, simply log in on the CUPS web interface and choose to add a new printer. As a device choose "Windows Printer via SAMBA".
For the device location, enter:
smb://username:password@hostname/printer_name
Or without a password:
smb://username@hostname/printer_name
Make sure that the user actually has access to the printer on the Windows computer and select the appropriate drivers. If the computer is located on a domain, make sure the user-name includes the domain:
smb://username:password@domain/hostname/printer_name
If your network contains many printers, use lpoptions -d your_desired_default_printer_name to set your preferred printer.
Windows Client
Sometimes you might want to allow a Windows computer to connect to your GNU/Linux server. There are a few ways to do this, including Samba. In order to do this, you will have to edit your /etc/samba/smb.conf file to allow access to your printers. Your smb.conf can look something like this:
[global] workgroup=Heroes server string=Arch Linux Print Server security=user [printers] comment=All Printers path=/var/spool/samba browseable=yes # to allow user 'guest account' to print. guest ok=no writable=no printable=yes create mode=0700 write list=@adm root neocephas
That should be enough to share your printer, but you just might want to add an individual printer entry:
[ML1250] comment=Samsung ML-1250 Laser Printer printer=ml1250 path=/var/spool/samba printing=cups printable=yes printer admin=@admin root neocephas user client driver=yes # to allow user 'guest account' to print. guest ok=no writable=no write list=@adm root neocephas valid users=@adm root neocephas
Please note that this assumes configuration was made so that users must have a valid account to access the printer. To have a public printer, set guest ok to yes, and remove the valid users line. To add accounts, you must set up a regular GNU/Linux account and then set up a Samba password on the server. For instance:
# useradd neocephas # smbpasswd -a neocephas
After setting up any user accounts that you need, you will also need to set up the samba spool directory:
# mkdir /var/spool/samba # chmod 777 /var/spool/samba
The next items that need changing are /etc/cups/mime.convs and /etc/cups/mime.types:
mime.convs:
# The following line is found at near the end of the file. Uncomment it. application/octet-stream application/vnd.cups-raw 0 -
mime.types:
# Again near the end of the file. application/octet-stream
The changes to mime.convs and mime.types are needed to make CUPS print Microsoft Office document files. Many users seem to need that.
After this, restart your Samba daemon:
# /etc/rc.d/samba restart
Obviously, there are a lot of tweaks and customizations that can be done with setting up a Samba print server, so it is advised to look at the Samba and CUPS documentation for more help. The smb.conf.example file also has some good samples to that you might want to look at.
Windows 2000 and Windows XP
For the most modern flavors of Windows, an alternative way of connecting to your GNU/Linux printer server is to use the CUPS protocol directly. The Windows client will need to be using Windows 2000 or Windows XP. Make sure you allow the clients to access the print server by editing the location settings as specified in section 4.1.
On the Windows computer, go to the printer control panel and choose to 'Add a New Printer'. Next, choose to give a URL. For the URL, type in the location of your printer: http://host_ip_address:631/printers/printer_name (where host_ip_address is the GNU/Linux server's IP address and printer_name is the name of the printer you are connecting to).
After this, install the printer drivers for the Windows computer. If you setup the CUPS server to use its own printer drivers, then you can just select a generic postscript printer for the Windows client. You can then test your print setup by printing a test page.
Other Operating Systems
More information on interfacing CUPS with other printing systems can be found in the CUPS manual, e.g. on http://localhost:631/sam.html#PRINTING_OTHER
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 you want to solve your problems:
- An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when you select 'print' (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 you have your printer 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.
...as a result of an upgrade
CUPS stops working
The chances are that a new configuration file is needed for the new version to work properly. You may get "404 - page not found" errors 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 the configuration if needed):
# cp /etc/cups/cupsd.conf.default /etc/cups/cupsd.conf
and restart CUPS to employ the new settings.
Error with gnutls
If you recieve errors such as:
/usr/sbin/cupsd: error while loading shared libraries: libgnutls.so.13: cannot open shared object file: No such file or directory
you may need to update gnutls:
# pacman -Sy gnutls
After updating, there may be a file named cupsd.conf.pacnew in /etc/cups. This is the unmodified original configuration file that has been placed as part of the update. Compare it with the currently installed version and adjust to preference.
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 (http://localhost:631), go to Printers > Delete Printer.
If you do not remember your printer's settings, go to Printers > Modify Printer. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.
The PPD version (XXXXXX) is not compatible with Gutenprint X
Run:
# /usr/sbin/cups-genppdupdate
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:
Configuration file
The syntax of the configuration file cupsd.conf changed. You should start with a new cupsd.conf file based on /etc/cups/cupsd.conf.default.
Blacklisting usblp
CUPS now uses libusb and printer USB devices (under /dev/bus/usb/) instead of the usblp generated /dev/usb/lpX ones. In order to get USB printers working, you need to disable the usblp module. This can be done by blacklisting it in your /etc/rc.conf file, or by adding "blacklist usblp" to a configuration file in /etc/modprobe.d. Some users have also reported that they needed to reinstall their printer.
Device node permissions
In addition to usblp not being loaded, CUPS also 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 # the ones from the old usblp kernel module SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}==":0701*:", GROUP="lp", MODE="660"
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 you need to add a custom udev rule. See below.
Troubleshooting
You can get the device file of your printer 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, you can enforce it by creating a custom udev rule, e.g
cat /etc/udev/rules.d/10-usbprinter.rules ATTR{idVendor}=="04b8", ATTR{idProduct}=="0841", MODE:="0660", GROUP:="lp"
Note that idVendor and idProduct are from the lsusb listing above.
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
A HPLIP printer sends "/usr/lib/cups/backend/hp failed" error
Make sure dbus is installed and running, e.g. check DAEMONS in /etc/rc.conf or run ls /var/run/daemons.
hp-toolbox sends an error, "Unable to communicate with device"
If running hp-toolbox as a regular user results in:
# hp-toolbox # error: Unable to communicate with device (code=12): hp:/usb/<your printer id>
or, "Unable to communicate with device"", then you may have to add yourself to the lp group by running the following command:
# gpasswd -a <username> lp
CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer
If you receive 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
or:
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!
make sure you have hplip installed, in addition to the packages mentioned above, net-snmp is also needed. See: http://bbs.archlinux.org/viewtopic.php?id=65615
# pacman -S hplip
Printing fails with unauthorised error
If you added yourself to the lp group, and allowed your user to print (set in cups.conf), then the problem lies in /etc/cups/printers.conf. This line could be the culprit:
AuthInfoRequired negotiate
Comment it out and restart CUPS.
Print button greyed-out in GNOME print dialogs
Be sure the package: libgnomeprint is installed
Edit /etc/cups/cupsd.conf and add
# HostNameLookups Double
Restart CUPS:
# /etc/rc.d/cups restart
Source: http://bbs.archlinux.org/viewtopic.php?id=70418
CUPS fails to print with 'Unable to open device "hal:///[...]": Permission denied'
The permissions on some files are wrong:
# cd /usr/lib/cups/backend # chmod 700 hal # (previously 755) # chmod 700 usb # (previously 755)
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 you are having trouble specifying the correct device location in CUPS you can run the following command to list all shares available (to a certain windows username):
$ smbtree -U windowsusername
Will list every share available to a certain Windows username on your local area network subnet, as long as Samba is set up and running properly. It should return something like this:
WORKGROUP \\REGULATOR-PC \\REGULATOR-PC\Z \\REGULATOR-PC\Public \\REGULATOR-PC\print$ Printer Drivers \\REGULATOR-PC\G \\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series
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.
Printer-specific
This section is dedicated to specific problems and their solutions.
Brother DCP 7020
See: Brother_DCP-7020
Epson AcuLaser CX11(NF)
Install Epson-ALCX11-filter from AUR. Restart CUPS and add the printer using the driver "EPSON AL-CX11, ESC/PageS Filter".
Both connections, USB and network, should work as expected.
FX C1110 (not model B)
Keep in mind that these directions assume that the printer is connected and listening on the network.
- Install cpio and rpmunpack to later unpack the package:
# pacman -S cpio rpmunpack cups ghostscript gsfonts
- Get the FX GNU/Linux Driver here.
- Unzip fxlinuxprint-1.0.1-1.i386.zip to /var/tmp (the directory is not important):
$ unzip fxlinuxprint-1.0.1-1.i386.zip -d /var/tmp
- Continue extracting the file:
$ cd /var/tmp $ rpmunpack fxlinuxprint-1.0.1-1.i386.rpm $ gunzip fxlinuxprint-1.0.1-1.cpio.gz
- Move the cpio DST file (for convenience):
$ mkdir /var/tmp/DST $ mv fxlinuxprint-1.0.1-1.cpio /var/tmp/DST
- Extract it:
$ cd /var/tmp/DST $ cpio -id < fxlinuxprint-1.0.1-1.cpio
- Filter the relevant files:
$ cd /var/tmp $ find /var/tmp/DST -type f |cat -n 1 /var/tmp/DST/etc/cups/mimefx.convs 2 /var/tmp/DST/etc/cups/mimefx.types 3 /var/tmp/DST/usr/lib/cups/filter/pdftopjlfx 4 /var/tmp/DST/usr/lib/cups/filter/pstopdffx 5 /var/tmp/DST/usr/lib/cups/filter/pdftopdffx 6 /var/tmp/DST/usr/share/cups/model/FujiXerox/en/fxlinuxprint.ppd
- Copy the files found in the previous step to /
- Access http://localhost:631/ and add the lpd://f.q.d.n/queue printer, aunthenticating as root.
- Go through "Manage Printer" and "Set Printer Options".
- Print a test page (substitue color103 with the assigned printer name):
$ lpq -P color103 color103 is ready no entries
Printing does not work with the HP Deskjet 700 Series
The solution is to install pnm2ppa printer filter for the HP Deskjet 700 series. Without this, the print jobs will be aborted by the system. A PKGBUILD for pnm2ppa can be found in AUR.
Getting HP LaserJet 1010 to work
A solution may be to compile a newer version of GhostScript:
$ pacman -Qs cups a2ps psutils foo ghost local/cups 1.1.23-3 The CUPS Printing System local/a2ps 4.13b-3 a2ps is an Any to PostScript filter local/psutils p17-3 A set of postscript utilities. local/foomatic-db 3.0.2-1 Foomatic is a system for using free software printer drivers with common spoolers on Unix local/foomatic-db-engine 3.0.2-1 Foomatic is a system for using free software printer drivers with common spoolers on Unix local/foomatic-db-ppd 3.0.2-1 Foomatic is a system for using free software printer drivers with common spoolers on Unix local/foomatic-filters 3.0.2-1 Foomatic is a system for using free software printer drivers with common spoolers on Unix local/espgs 8.15.1-1 ESP Ghostscript
You may also have to set LogLevel
in /etc/cups/cupsd.conf to debug2
, this way the logs will show you how to circumvent minor issues, such as missing fonts. See: http://www.google.com/search?q=n019003l+filetype%3Apfb
The debug solution might work if you get errors similar to 'Unsupport PCL', etc. See: http://linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1010
HP LaserJet 1020
Installation from AUR
Install the package foo2zjs from AUR and modify the PKGBUILD. Change the line:
./getweb all
to
./getweb 1020
If you get errors with incorrect md5sums, you should also change the md5sum of foo2zjs.tar.gz in PKGBUILD to match the downloaded driver.
As a last step, add and configure the printer in the CUPS manager. The printer should be recognized automatically, and function for both root and regular users.
Manual installation
First of all, you only need to install CUPS and GhostScript. Then follow the links in http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1020 and http://foo2zjs.rkkda.com/ to the printer driver page, and follow the install instructions. After login in as root, and downloading all the package and extracted the archives, change into the foo2zjs directory. Now you can follow the regular installation instructions with a minor modification to change the 'userid' for printing:
$ make $ ./getweb 1020
Open the Makefile:
$ nano Makefile
and search for the line:
# LPuid=-olp
modify it to:
# LPuid=-oroot
then continue with the script:
$ make install $ make install-hotplug $ make cups
Printer connected to an Airport Express Station
The first step is to scan the Airport Express station. It seems that there are different addresses depending on the model:
[root@somostation somos]# nmap 192.168.0.4 Starting Nmap 4.20 ( http://insecure.org ) at 2007-06-26 00:50 CEST Interesting ports on 192.168.0.4: Not shown: 1694 closed ports PORT STATE SERVICE 5000/tcp open UPnP 9100/tcp open jetdirect 10000/tcp open snet-sensor-mgmt MAC Address: 00:14:51:70:D5:66 (Apple Computer) Nmap finished: 1 IP address (1 host up) scanned in 25.815 seconds
The Airport station is accessed like an HP JetDirect printer. Afterwards, you can edit printer.conf:
# Printer configuration file for CUPS v1.2.11 # Written by cupsd on 2007-06-26 00:44 <Printer LaserSim> Info SAMSUNG ML-1510 gdi Location SomoStation DeviceURI socket://192.168.0.4:9100 State Idle StateTime 1182811465 Accepting Yes Shared Yes JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0 OpPolicy default ErrorPolicy stop-printer </Printer>
Problems may be resolved by removing foomatic and installing foomatic-db, foomatic-db-engine, foomatic-db-ppd instead.
Appendix
Alternative CUPS Interfaces
If you are a GNOME user, you can manage and configure your printer by using the gnome-cups-manager. This package is available through pacman if you have the "community" repository uncommented in /etc/pacman.conf.
# pacman -S gnome-cups-manager
Alternatively, you may also install system-config-printer-gnome from the "community" repository:
# pacman -S system-config-printer-gnome
For system-config-printer to work as it should you may run as root or with sudo/gksudo, or alternatively set up a "normal" user to administer cups (if so follow steps 1-3)
- 1. Create group, and add a user
# groupadd lpadmin # usermod -aG lpadmin <username>
- 2. Add "lpadmin" (without the quotes) to this line in /etc/cups/cupsd.conf
SystemGroup sys root <insert here>
- 3. Restart cups, log out and in again (or restart your computer)
# /etc/rc.d/cups restart
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 gtklp:
# pacman -S gtklp
Utility Functions on Epson Printers
Escputil
This section explains how to perform some of the utility functions (such as nozzle cleaning) on Epson printers, by using the escputil utility, part of the gutenprint package.
There is a escputil's man-page provides basic information, but it does not touch on how to identify the printer. There are two parameters that can be used to do so:
- One is --printer: it expects the name you used to identify your printer when you configured it.
- The other is --raw-device: this option expects a path beginning with "/dev". If your printer is the only serial printer on the system, "/dev/lp0" should be its device node. For USB printers, it is "/dev/usb/lp0". If you have more than one printer, they will have names ending in "lp1", "lp2", etc.
On to the mantainance options:
- To clean the printer heads:
$ escputil -u --clean-head
- To print the nozzle-check pattern (allowing you to verify that the previous head cleaning worked, or to determine that you need to clean the heads):
$ escputil -u --nozzle-check
If you want to perform an operation that requires two-way communication with a printer, you must use the "--raw-device" specification and your user must be root or be a member of the group "lp".
- The following is an example of getting the printer's internal identification:
$ sudo escputil --raw-device=/dev/usb/lp0 --identify
- To print out the ink levels of the printer:
$ sudo escputil --raw-device=/dev/usb/lp0 --ink-level
Mtink
This is a printer status monitor which enables to get the remaining ink quantity, to print test patterns, to reset printer and to clean nozzle. It use an intuitive graphical user interface. Package can be downloaded from AUR.
Stylus-Toolbox
This is a GUI using escputil and cups drivers. It supports nearly all USB printer of Epson and displays ink quantity, can clean and align print heads and print test patterns. It can be downloaded from AUR
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.
You can find generated PDF documents in a directory of your user name located in /var/spool/cups-pdf
directory.
This package can be installed by the following command:
# pacman -S cups-pdf
After installing the package, you can set it up as you would for any other printer in the web interface. For the Device, select CUPS-PDF (Virtual PDF Printer); Make/Manufacturer, choose Generic; Model/Driver, select Generic postscript color printer. Alternatively, provide the PPD file from this link: [2].
Print to Postscript: A CUPS-PDF Virtual Printer Trick
Printing to PDF in most applications like OpenOffice is no problem, just hit the button, but if you want to print to postscript, then things 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 you need to do is capture 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, click "print" and you are left with a very nice postscript file.
Configuring the CUPS-PDF Virtual Printer
1. Install cups & cups-pdf from extra.
2. Start cups with:
# /etc/rc.d/cups
3. Access the cups print manager: http://localhost:631 and select:
Administration -> Find New Printers Select CUPS-PDF (Virtual PDF), choose for the make and driver: Make: Generic Driver: Generic CUPS-PDF Printer
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.
External Links
- Official CUPS documentation, locally installed
- Official CUPS Website
- Linux Printing, The Linux Foundation
- Tips and Suggestions on common CUPS problems, (Dead link)
- Gentoo's Printing Guide, Gentoo Documentation Resources
- Arch Linux User Forums