Printing in Linux can be a confusing territory. Many distributions donât come with printing enabled by default, leaving it up to the user to set it up. This article will show you how to set up a standard USB printer in Linux.
CUPS
The Common Unix Printer Service (CUPS), which was in fact developed by Apple, is the printer server that allows one to print in Linux. It can be used with a single, local computer or with a networked group of computers. CUPS offers a web-based configuration management tool for printers.
If your distribution doesnât have CUPS installed, use the appropriate command for your package manager to install it. For instance, if you are running Ubuntu, the command would be:
sudo apt-get install cups |
Installing CUPS will place an executable binary in the directory â/etc/init.dâ, which is for system services. Start it with:
sudo /etc/init.d/cupsd start |
Note: If you donât want to leave CUPS running all the time, you can stop the service with:
sudo /etc/init.d/cupsd stop |
If you are a power user, you may wish to modify the configuration file â/etc/cups/cupsd.confâ. That file will let you change certain printer settings, such as whether to enable shared printers and which type of authentication to use. If you make changes to this file while CUPS is already running, donât forget to restart the server:
sudo /etc/init.d/cupsd restart |
For more information about what you can do with the CUPS configuration file, visit the man page:
The Web-based CUPS Interface
Once you have CUPS running, you can visit the web-based interface by opening up a browser and navigating to localhost:631
. This address indicates that the server is running locally on port 631.
To get started, plug in your printer and go to the âAdministrationâ tab. In the âPrintersâ section at the top left of the page, cli ck âAdd Printer.â
The server will ask you for a username and password. You can log in as root, but if you want regular users to be able to use the printer too, you must add them to the lpadmin
group. The command to add a user to a group varies by distro; on Ubuntu, it is:
sudo usermod -aG lpadmin [username] |
If youâre lucky, your printer will be detected and shown in the list of discovered local and network printers.
Select the printer and continue. For this example, we are using a USB printer, but â" as you can see in the screenshot above â" this can also work for a wireless printer. The CUPS interface will give you a few options for configuring the printer. Check off the box beside âShare This Printerâ if you wish to allow other users on your network to access it.
Next, CUPS will attempt to autodetect your printerâs model. If it gets it wrong, you can select the correct model from the list of models that appears. If your particular model is not on the list, you can provide a PostScript Printer Definition (PPD) file. Some manufacturers may make the PPD available online for download.
Note: Some printers share the same PPD file with another model of t he same family and brand. If you canât find the PPD for your printer, check with the printerâs manufacturer for the details. You can also find a number of printer drivers at OpenPrinting.org
If youâre using a Hewlett-Packard (HP) printer, the easiest way to get CUPS to recognize it is to install Hewlett-Packardâs Linux Imaging and Printing Software (HPLIP). This collection of drivers may be included in one of your package repositories as âhplip.â Once youâve installed it, refresh the âAdd Printerâ page in your browser. If all went according to plan, your HP printer should now show up in the list of supported models.
After youâve successfully added your printer, CUPS will present you with some more configuration options. If you have a standard home printer, youâll probably wish to change the default media size to â Letter.â
Now you can use the print dialog in any application to use the printer you set up.
When you are printing, you can go back to the CUPS administration page and click on the âJobsâ tab to view a list of running and queued print jobs.
And thatâs that! Once youâve followed the instructions above, your printer should be working in Linux.
Image credit: Open Clip Art Library
No comments:
Post a Comment