chrislale@users.sourceforge.net
| Revision History | ||
|---|---|---|
| Revision 0.02 | 28 April 2004 | Revised by: cl |
| Added meta keywords. Moved 'About this document' to an appendix. | ||
| Revision 0.01 | 6th February 2004 | Revised by: cl |
| First release. Developed and tested using Debian GNU/Linux 3.0 (Woody) and the Debian package CUPS version 1.1.14-3. This document was composed using LyX qt version 1.3.3, exported to sgml and rendered to HTML using the newbieDoc style sheets and tools available from http://newbiedoc.sourceforge.net/tarballs/newbiedoc-lyx-files_0.02.tar.gz. | ||
lpr/lpd is the BSD line printer spooling system. lprng is an enhanced, extended, and portable version of lpr. lpr is the system that is installed by default on a standard Debian 3.0 installation. If you have a non-PostScript printer, you must create a filter file called /etc/printcap (normally using apsfilter or magicfilter). Together with the ghostscript PostScript interpreter, the filter turns your PostScript output into the output needed for a non-PostScript printer.
This document is describes cups, not lpr. If you wish to use lpr, read the document describing how to configure printing using lpr at http://newbiedoc.sourceforge.net/peripherals/printer-magicfilter.html.
cups is the Common UNIX Printing System it is a replacement for replacement for lpr and lprng. lpr or lprng will be removed, but your existing /etc/printcap file will remain on your system (unless you remove it using the purge option).
Each cups printer has a Postscript Printer Description (.ppd) file (see the Linux Dictionary at www.tldp.org/LDP/Linux-Dictionary/html/index.html).
You can find .ppd files for many printers using the Foomatic database (Debian packages foomatic-bin and foomatic-db).If you cannot find your printer there, you can download many .ppd files from http://www.linuxprinting.org/. A few manufacturers, such as Samsung, provide their own .ppd files. Visit your printer manufacturer's web site.
cups has an HTML front end. There are alternative front ends for cups available in the Debian 3.0 distribution such as gtklp (Gnome), qtcups (KDE) and xpp. This document describes the use of the HTML front end only.
![]() | Use of # for remarks |
|---|---|
The # character normally represents a command prompt. Here it indicates a comment line. |
# Check for parallel port or USB support in the Linux kernel dmesg | grep parport dmesg | grep usb # Install cups apt-get install cupsys cupsys-bsd cupsys-client cupsys-driver-gimpprint cupsys-pstoraster libcupsys2 # Install foomatic apt-get install foomatic-bin foomatic-db # Use a browser to visit the local cups Admin web page http://localhost:631/admin # Log in to the cups Admin web page as root User Name: Password: OK # Install your printer in cups Printers Add printer # Configure your printer in cups Printers Configure Printer # Test your printer from cups Printers Print Test Page # Optional: install an alternative front end for managing cups # gtklp (Gnome) apt-get install gtklp # or qtcups (KDE) apt-get install qtcups # or xpp apt-get install xpp |
You may already have printer port support in your kernel. If not, you must install the necessary kernel modules (see the appendix on setting up kernel printer port support). If your kernel does not allow modules, you should think about upgrading your kernel.
You can check for printer port support by looking at the boot messages using dmesg, and filtering the output using a pipe to grep.
If you have a standard PC with a parallel port, the output should look something like this:
$ dmesg | grep parport parport0: PC-style at 0x378 [PCSPP,EPP] parport0: Printer, printer-name parport_pc: Via x86A parallel port: io=0x378 lp0: using parport0 (polling). $ |
Look for mention of parport0 and parport_pc. You would expect to see both if your kernel already supports a parallel printer.
![]() | This section is untested |
|---|---|
I do not have a USB printer, so this is my 'best guess' at how to install one. If you get a USB printer working please let me know (<feedback.chrislale@coolscience.co.uk>) and I will update this document. |
You should get similar messages by grepping for USB ports using dmesg | grep usb. I have not been able to test this because I do not have a USB printer.
$ dmesg | grep usb |
![]() | lpr or lprng will be removed. |
|---|---|
Any existing system will be removed, but your printcap file will be retained. If you decide later to re-install lpr or lprng, should not need to create a new printcap file. If you are concerned, make a backup copy of /etc/printcap. |
You need a number of Debian packages to install cups.
cupsys provides the cups scheduler/daemon
cupsys-bsd provides the BSD commands for interacting with cups, and replaces any existing lpr or lprng package.
cupsys-client provides the System V style print client programs.
cupsys-driver-gimpprint provides a cups driver based on gimpprint.
cupsys-pstoraster allows cups to convert PostScript data into cups raster data.
libcupsys2 provides the base shared libraries for cups.
a2ps is the 'Anything to PostScript' converter and pretty-printer. It may already be installed. If not, this makes sure that it is installed.
Login as a normal user. If you are running an X Session, open a terminal window (eg gnome terminal). Switch user to Root and use apt to install the packages.
$ su Password: ******* # apt-get install cupsys cupsys-bsd cupsys-client cupsys-driver-gimpprint cupsys-pstoraster libcupsys2 # exit $ |
![]() | The foomatic database provides many.ppd printer drivers. |
|---|---|
The cups package provides drivers for a few generic printers. You may find specific drivers for your printer from the manufacturer's web site or from www.linuxprinting.org/. You can skip this section if you already have a .ppd file for your printer. |
Install foomatic and the PostScript filter 'Anything to Postscript' (a2ps).
$ su Password: ******* # apt-get install foomatic-bin foomatic-db a2ps |
You must choose a filter configuration. Read the details on the ncurses screens. Choose the default settings if you are not sure.
![]() | Ncurses navigation |
|---|---|
Use the arrow keys and the <Tab> key to make your selection. Selected items are highlighted in blue. Use the <Enter> key to confirm your selection. |
Debian Configuration Foomatic Printfilter Configuration ... <Ok> Debian Configuration Foomatic Printfilter Configuration ... Preserve manual changes when regenerating config files parse <Ok> |
You must select a PostScript filter. Select a2ps. Exit from user Root's account when you have finished.
Debian Configuration Foomatic Printfilter Configuration ... a2ps <Ok> # exit $ |
![]() | Install a .ppd driver not provided by the foomatic package. |
|---|---|
You can skip this section if you are not using one of the drivers provided by the foomatic package or one of the generic drivers provided by the cups package itself. |
You may have a .ppd file from the manufacturer or from www.linuxprinting.org/. Alternatively (you might be in a hurry!), use one of cups' generic drivers.
Copy the file to /etc/share/cups/model, then stop and start the cups daemon to make cups use it. You must be Root to do this.
$ su Password: ******* # cp path-to-filename.ppd /etc/share/cups/model/ # /etc/init.d/cupsys stop Stopping CUPSys: cupsd. # /etc/init.d/cupsys start Starting CUPSys: cupsd. Go back to being a normal user. # exit $ |
![]() | Browser variations |
|---|---|
You can find login instructions for various browsers (both X and console based) in the appendix on using various browsers. The following instructions are as generic as possible. |
Use a web browser to visit the cups Admin web page. Enter the name and password of the Root user when you are prompted.
http://localhost:631/admin User name: root Password: ******* OK |
Navigate to the Printers menu in the Admin main menu page. Choose to add a printer.
Admin main menu
Printers menu
Add printer
|
Enter a name, a location and a description for your printer.
The printer name may only contain letters, numbers, and the underline character. If this is your first (or only) printer, the name defaults to lp. This is a sensible choice because lp is recognised by cups as the default printer. The location is probably only useful if you have a network with printers in several places. It can be left blank. The description identifies the printer to people. Manufacturer and model number would be good choices here.
This is how you would add a new printer called printer-name. The model is printer-model, the manufacturer is printer-make and you are using the first parallel port on your computer (lp0).
Add New Printer dialog
Name: printer-name
Location:
Description: printer-make printer-model
Continue
|
The Device is the name of the printer port on your computer. This is often the parallel port but may be a USB port. Further detail on configuring your computer's ports is in the appendix about kernell printer support. Specify the make of your printer. If your printer is not listed, either install the foomatic package or supply a .ppd file from the manufacturer's web site or from www.linuxprinting.org/. (See the section on installing a .ppd file.)
Device for printer-name dialog Device: Parallel Port #1 Continue Model/Driver for printer-name dialog Make: printer-make Continue Model: printer-model Continue Printer printer-name has been added successfully. |
Navigate to Admin main menu page. Find your printer's menu in the Printer menu page. Choose Configure Printer.
Admin menu Printer menu printer-name menu Configure Printer |
You will probably want to configure the page size straight away. You can always make other configuration changes later.
Admin menu: Choose default options for printername.
Page size: A4
Continue
Printer printer-name has been configured successfully.
|
Navigate to Admin main menu page. Find your printer's menu in the Printer menu page. Choose Configure Printer.
Admin menu Printers menu Manage Printers |
Print a test page to check the new cups configuration.
Printer menu
printer-name
Print Test Page
|
Reconfigure your printer if necessary (see the previous section on setting default options). When you are happy with the result, print a page from an application, eg a text editor.
Some people prefer to manage their printers using a web browser. If you want an alternative X front end to cups, you can try these applications.
gtklp (Gnome)
qtcups (KDE)
xpp
You can find out more about each application, or install them, using apt. For example, this is how you might find the details of the gtklp package and then install it.
$ apt-cache show gtklp Description: Front end for cups written in gtk ... $ su Password: ******* # apt-get install gtklp ... # exit $ |
You should login as a normal user rather than as the superuser (user Root).
If necessary, you can switch user to Root from a normal user's account. using the switch user (su) command. You need Root's password for this.
There are several applications that install Debian packages. synaptic is an X Window System progam and aptitude is an ncurses program which runs on a terminal or in a terminal window in X. apt runs from the command line. The examples in this document use apt.
Use apt to install a package.
# apt-get install package-name |
Use apt to remove a package.
# apt-get remove package-name |
Run mozilla and open web location http://localhost:631/admin. Enter user Root's user name and password when prompted/
Prompt dialog
User Name: root
Password: *******
OK
|
Run galeon and open web location http://localhost:631/admin. Enter user Root's user name and password when prompted.
Galeon dialog
Enter user name and password for "CUPS" at localhost:631
User name root
Password *******
OK
|
Run konqueror. Visit the cups web page at http://localhost:631/admin. Click on the Administration button in the menu bar at the top of the page. Enter user Root's user name and password when prompted.
Printer menu page Administration Authorization dialog Username root Password ******* OK |
Run lynx from a terminal or a terminal window. Go to the cups web page at http://localhost:631/admin. You may briefly see an error message before lynx asks for your user name and password.
$ lynx http://localhost:631/admin Alert!: Access without authorization denied -- retrying Username for 'CUPS' at server 'localhost:631': root Password: ******* |
Do not forget to use the full URL including 'http://'
$ links http://localhost:631/admin
Unauthorized
HTTP Authentication dialog
Authentication required for CUPS at http://localhost:631/admin
Login root
Password *******
OK
|
The Linux kernel is the core of the operating system. Adding many features would reduce Linux's performance. The solution is to compile (build) the kernel with basic features that almost everyone will want, but to allow other features to be added on later as modules. Your printer will not work without kernel support.
You may already have run a check for kernel printer port support using dmesg in the section on Linux kernel printer support. You can double-check, install and remove kernel modules with modconf (module configuration utility).
Run modconf as the Root user from a terminal or terminal window.
$ su
Password: *******
# modconf
|
![]() | Ncurses navigation |
|---|---|
Use the arrow keys and the <Tab> key to make your selections. Selected items are highlighted in blue. Use the <Enter> key to confirm your selection. |
Select Category menu
kernel/drivers/parport Parallel port support.
<Ok>
|
Loaded modules are tagged with a plus sign (+). You need two modules for a standard PC parallel port: parport and parport_pc.
You already have parallel port support if you see plus signs (+).
Select kernel/drivers/parport modules menu
parport + Parallel-port support
parport_pc + PC-style hardware
|
If either is flagged with minus signs (-), go straight on to the next section on installing parallel port modules.
If both modules are already installed, exit from the menu, exit from modconf and exit from the Root user's account.
Select kernel/drivers/parport modules menu Exit Finished. Return to previous menu. <Ok> Select Category menu Exit Finished. Return to previous menu. <Ok> # exit $ |
Finished with this appendix!
You do not have parallel port support if you see minus signs (-) on either parport or parport_pc.
Select kernel/drivers/parport modules menu
parport - Parallel-port support
parport_pc - PC-style hardware
|
Install each module by highlighting it (in blue) and choosing <Ok>. If you are asked for any command line arguments, it is safe to leave the entry box blank. Anyone who uses a printer that needs command line arguments would probably know what the arguments are.
Select kernel/drivers/parport modules menu
parport - Parallel-port support
<Ok>
parport_pc - PC-style hardware
<Ok>
|
When both modules are installed, exit from the menu, exit from modconf and exit from the Root user's account.
Select kernel/drivers/parport modules menu Exit Finished. Return to previous menu. <Ok> Select Category menu Exit Finished. Return to previous menu. <Ok> # exit $ |
Finished with this appendix!
![]() | This section is untested |
|---|---|
I do not have a USB printer, so this is my 'best guess' at how to install one. If you get a USB printer working please let me know (<feedback.chrislale.@coolscience.co.uk>) and I will update this document. |
You must be Root to use modconf.
$ su
Password: *******
# modconf
|
![]() | Ncurses navigation |
|---|---|
Use the arrow keys and the <Tab> key to make your selections. Selected items are highlighted in blue. Use the <Enter> key to confirm your selection. |
Select Category menu
kernel/drivers/usb Universal Serial Bus (USB).
<Ok>
|
Loaded modules are tagged with a plus sign (+).
You already have USB printer support if you see a plus sign (+) against USB Printer support.
Select kernel/drivers/parport modules menu
printer + USB Printer support
|
If there is a minus sign (-), go straight on to the next section on installing the USB printer module.
If the module is already installed, exit from the menu, exit from modconf and exit from the Root user's account.
Select kernel/drivers/parport modules menu Exit Finished. Return to previous menu. <Ok> Select Category menu Exit Finished. Return to previous menu. <Ok> # exit $ |
Finished with this appendix!
You do not have USB support if you see a minus signs (-) against USB Printer support.
Select kernel/drivers/usb modules menu
printer - USB Printer support
|
Install the module by highlighting it (in blue) and choosing <Ok>. If you do not know of any command line arguments, leave the entry box blank.
Select kernel/drivers/usb modules menu printer - USB Printer support <Ok> printer menu Install this module in the kernel? <Yes> Enter Command-Line Arguments menu _________________________________ <Ok> |
When you have installed the module, exit from the menu, exit from modconf and exit from the Root user's account.
Select kernel/drivers/usb modules menu Exit Finished. Return to previous menu. <Ok> Select Category menu Exit Finished. Return to previous menu. <Ok> # exit $ |
Finished with this appendix!
Appendix: About this document
Copyright ©2004 Chris Lale <feedback.chrislale@coolscience.co.uk>. Permission is granted to copy, distribute and/or modify this document with no Invariant Sections, with no Front-Cover texts and with no Back-Cover Texts under the terms of the GNU Free Documentation License, version 1.1 or any later version, published by the Free Software Foundation. A copy of the license can be found at http://www.fsf.org/copyleft/fdl.html.
You can get the latest version of this document from http://newbiedoc.sourceforge.net.
If you find any errors, omissions etc, please let me know via the newbieDoc Discussion list <newbiedoc-discuss@lists.sourceforge.net> or <feedback.chrislale@coolscience.co.uk>.
I have written this document in English. I have used American spellings for some technical terms eg 'program' where these have become widely accepted.
You can find guides to English spelling, punctuation and grammar at http://www.cral.ac.uk/guidelines/.
Three dots ...
if before text, indicates text has been omitted in front of the text
if after text, indicates that following text has been omitted.
if on one line by themselves indicates that lines have been omitted.
A '$' at the start of a line indicates that the rest of the line is input from a normal user. A '#' indicates that the Root user inputs the rest of the line.
Filenames, application names, package names and text displayed by a console or terminal window look like this.
my-file.txt my-directory /my-path/my-directory/ my-application my-package This is some terminal text. |
Filenames, application names, package names and text displayed in an X window look like this.
my-file.txt my-application my-package This is some text in an X window. |
Commands issued from a terminal look like this. Use of the <ENTER> key is implied but not shown.
$ my command |
This example shows a command issued in an X application.
Menu bar: File -> Close
|