Linux printing made easy, Part 1

March 26, 2001, 09:12 AM —  LinuxWorld.com — 


Welcome to the latest edition of Ask the Geek. As I mentioned in my last column, this week we are going to start a series on using the Common Unix Printing System (CUPS), which can introduce a universal printing solution to your network.



The world of printing for Unix/Linux has not changed much in a very long time. We still use good old lpd (the line printer daemon), we don't have support for IPP (Internet Printing Protocol), and we still don't have the ability to use many printers. But that situation is changing, and quickly. A new product is making inroads into the printing arena.



The CUPS software provides a way for Unix/Linux users to manage printing in an efficient and reliable manner. It natively supports IPP and has 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. In short, with CUPS you can run a printer on a Linux machine as easily as they can on a Windows machine, but with the power of Linux.

CUPS runneth over



That said, let's get our hands dirty. First, we need to acquire CUPS. If you're running Mandrake 7.2, you already have it. (Yes, a shameless recommendation; it's what I run on my home machine.) If you are running another distribution, however, you'll need to download it (see Resources for the distribution site).



Once you've downloaded CUPS, you'll need to remove your old printing software. I'll explain this process using a machine running Red Hat 6.2 as an example. On such a machine, you must remove lpr, printtool, and rhs-printfilters before you install CUPS. You will want to keep these packages handy, though, in case CUPS doesn't work for you. If CUPS isn't your cup of tea, you can reinstall the packages and continue to be productive.



To remove these packages, type:




rpm -e lpr printtool rhs-printfilters




Then, install CUPS by typing:




rpm -ivh cups-1.1.4-linux-2.2.14-intel.rpm




Be aware that your filename may differ slightly.



CUPS is now installed. You should see the following message:




cups: scheduler started




This lets you know that CUPS is running and awaiting print jobs.



You can administer CUPS either at the command line or via a Web-based administrator. We will start by adding a printer from the command line interface. As the root user, type:




/usr/sbin/lpadmin -p LaserJet -E -v parallel:/dev/lp0 -m laserjet.ppd




The above lpadmin syntax performs the following tasks:

  1. Adds a printer called LaserJet (-p)
  2. Enables the printer to be used (-E)
  3. Sets the device and device type to use (-v)
  4. Uses the driver/PPD file laserjet.ppd (-m)



Since we're at the command line, the quickest way

I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
Free books

Essential JavaFX
Get started building rich Web apps quickly with an introduction to the power of JavaFX key features -- scene node graphs, nodes as components, the coordinate system, layout options, colors and gradients, custom classes with inheritance, animation, binding, and event handlers.Enter now!

The Nomadic Developer
Consulting can be hugely rewarding, but it's easy to fail if you are unprepared. To succeed, you need a mentor who knows the lay of the land. Aaron Erickson is your mentor, and this is your guidebook. Enter now!

Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

Marketplace