Introduction:
Remember using the chooser on Mac OS 9.x, ever long for that functionality on your Linux machine? Want to at a glance find a printer on your network, select it to configure it and then print on it. Need access to those windows printers on your network? There is hope and a solution with the Common Unix Printing System (CUPS) and graphical front ends such as xpp.
Also want OpenOffice to automatically find the printers you have configured? After configuring your printer with CUPS OpenOffice will automatically be able to use your printer without have to use a separate configuration utility like 'spadmin'.
Unix/Linux printing support was static for quite a while with the trusty old lpd (line printer daemon) that Unix Administrators learned. Cryptic requiring the command line interface but with many limitations since it came from the early day of Unix. It still exists in several forms and attempts to update it functionality with new implementations such as that found in LPRng which comes with Yellow Dog Linux.
Additional Information
CUPS, available under the GNU GPL, provides support for IPP (Internet Printing Protocol) as well as interfaces for LPD, SMB (Server Message Block, i.e., printers attached to Microsoft Windows), and JetDirect. CUPS can provide network printer browsing and use PostScript printer description (PPD) files. CUPS comes standard on distributions such as: Axon Linux, Caldera, Conectiva, easyLinux, Linux Mandrake, MIZI, and Peanut.
We will be building an RPM from the CUPS source in installing it into your Yellow Dog installation removing the LPRng package and configuring CUPS. Fortunately CUPS provides the rpm spec file so building the rpm is very easy. We then will start the CUPS server, configure a printer and finally print a test page.
Installing Cups
So now let's get it installed. You will need to be root for all this process.
- Download the zipped source code from www.cups.org (note I have had trouble with the US mirror corrupting the files but the German mirror has always worked fine for me).
The rpm build process expects the files to be in the directories under /usr/src/rpm ... you should see the following sub-directories: SOURCES (for the zipped source files) This is where the downloaded file should be placed. SPEC (for the rpm spec file. This file tells how to build the rpm file.) BUILD (the working directory for the rpm build process) RPMS (two sub dirs ppc, noarch - this is where the final binary rpms are put) SRPMS ( where the source RPMS are put)
- If you did not download the file into the SOURCES directory COPY it there now.
cp cups-1.1.14-source.targbz /usr/src/rpm/SOURCES [ENTER]
- Next we need to get the spec file.
tar -xzf cups-1.1.14-source.tar cups-1.1.14/cups.spec [ENTER] (extract the spec file)
mv cups-1.1.14/ cups.spec /usr/src/rpm/SPECS (mov the file) [ENTER]
rm -f cups-1.1.14 [ENTER] (now remove that directory that got created)
cd /usr/src/rpm/SPECS [ENTER]
ls -l [ENTER} (verify the cups.spec is owned by root)
... and you shoul see:
-rw-r--r-- 1 root root 5615 Feb 12 12:47 cups.spec root
... if it doesn't appear as the ower then:
chown root:root cups.spec
- Now we build the rpm
rpm -ba cups.spec [ENTER] (build the rpm - go get some coffee this could take a few minutes)
cd ../RPMS/ppc [ENTER]
If you now try:
rpm -Uvh --test cups*
... you will notice complaints for and conflicting installed packages, expect two 'LPRng' and 'lpr' (which comes in LPRng).
- So now remove the conflicts.
rpm -e --nodeps LPRng [ENTER]
rpm -e --nodeps printtool [ENTER] (it is optional to remove this but it is recomended)
- And install cups
rpm -Uvh cups*
If everything went right cups is installed.
- We now need to start the server and configure a printer. Drivers for a few printers are included and you will need to get the correct one for your printer and install it. One of the beauties of CUPS is that if you have a postscript printer you can use the ppd file that came with it as the driver.
- Next you need to find some basic information about your printer. For local printers you should know the port to which it is connected (i.e. serial com port 1, baud rate, parity, data bits, for networked printers - protocol (lpd, ipp, http) ip number, and queue (default is 9100) more more info check appendix B of the Software Administrators Manual found through the on-line help). Information on how to find ppd files is at the end of this HOWTO under Resources. Although a few come with CUPS you will probably need to get one for your specific printer:
a) You can find them at www.linuxprinting.org builds ppd's for a wide variety of printer including some very old ones.
b) Select the printer listings link on the left nav bar.
c) Or you can check at: http://www.cups.org - has a links to some sources of ppd's (Links->Software(under root)->Printer Drivers)
- Once you download your ppd file you need to copy it to '/usr/share/cups/model'
- Now start the server:
cupsd
This will start the server. Note that CUPS places its startup scripts in your init.d and rc.d directories so it will start up automatically on re-boots. If you want to change that you can use the SysV Init Editor. Note that if you aren't familiar with this tool you can cause your system to not boot properly so be warned.
- Open your browser and point to URL < localhost:631 > and the cups page should open.
- Now to setup your first printer click on the link: Do Administrative Tasks.
- You will get a login screen: Enter root as the username and your root password and click OK. Note you must have setup root with a password or CUPS will not allow you to the next screen.
- Click on Add Print.
- In the space after name enter what you want the printer called, user only alpha characters, no spaces.
- In Location give a description of the location of the printer.
- In Description give a description of the printer.
- Click on Continue.
Now we will set up the connection to the printer. This will vary according to the type of printer you have. If you have problems use the help button. I will show you how to set up a local serial printer, USB and Networked printers are also supported.
- Use the pull down after Device to select the interface for this printer. As you can see I have selected Serial Port #1. Click on continue.
- Now select the correct Baud Rates, parity, data bits, and flow control for which your printer is configured. You can find this information in your printer documentation. Click continue.
- Select the Manufacturer of your printer. If yours isn't listed then you didn't get the driver (ppd file) installed correctly. After you find the correct one you will need to kill the cupsd server process and restart it for the new printer driver to be recognized.
- Now select your printer model. Again if yours doesn't appear try another driver (ppd file).
- Congratulations you successfully configured your first printer!
- Now click on printers to see the status of your printer.
- To now test your printer you can click on Print Test Page and in a few seconds your printer show start printing the test page.
You now have cups up and running. Printing for KDE or Gnome is simple select print the way you normally do and be sure that Generic Unix LPD print system is selected in the pull down after the option Print system normally used.
OpenOffice recognizes printers configured in CUPS automatically without having to run spadmin. Simply select print and your printer.
If you have any problems refer to the on-line help in the CUPS administration pages (localhost:631). The Software Users Manual and the Software Administration Manuals are very thorough.
Resources
printing.kde.org
cups.sourceforge.net/xpp
www.linuxprinting.org
www.cups.org
This HOWTO was written by Phil Hopkins





