Tuesday, August 16, 2016

[CentOS - CUPS Print Server]: How to Add printer in Linux Adding Printer to CUPS Server Procedure

How to Add printer in Linux Adding Printer to CUPS Server Procedure


In this article we are going to learn how to add printer in Linux and Adding Printer to CUPS Server procedure. Most of Linux users feel that adding / installing printer in Linux is hard, some times we have to say yes because all the printer models does not have proper drivers for Linux.
Still most of branded printers will work easily with Linux Operating System.

How to Add Printer in Linux RHEL 7 / Centos 7

Below is the process to install an printer from GUI Mode
First Step
Installing Printer in RHEL7
Sundry -> Printer Settings
Add Printer Wizard How to add printer in Linux
Adding Printer Wizard
Add Printer Device URI
Add Printer Device URI
Here is the main step where we can select the printer based on its connectivity.
Serial Port #1 – If your printer connected through serial / parallel cable as a local printer then select Serial Port #1 Or #2.
If your Printer is connected through Network then Select Network printer option again here Select the type which is the best for your printer. If you already have CUPS server then that CUPS server URL.
Select Printer Make
Select Printer Make
In this screen Select the option carefully, Select printer from Database is the option few of the printer drivers already available in Linux along with OS. Provide PPD is the option where we have to download driver file from vendor site and attach.
Click Forward
Select Printer Model
Select Printer Model
Click Forward
Add Printer Description and Click Apply
Add Printer Description and Click Apply
Provide Printer Name and Printer description then Click on Apply
How to Add printer in Linux Adding Printer to CUPS Server Procedure
Printer has been successfully

Adding Printer to CUPS Server Procedure

This procedure has been written assuming CUPS server is already exists and adding printer to CUPS server
[ravi@TechTutorials~]$ sudo /usr/sbin/lpadmin -p HYDPRINTER -v socket://192.168.2.21:9100 -D "HYD - Cannon MF220 printer" -L "HYD" -o printer-error-policy="retry-job" -u allow:all -m textonly.ppd
Let’s see options
  • -p <Printer Name>
  • -v <Device URI>
  • -D <Description>
  • -L <Location>
  • -o <Options>
  • -u <User to allow>
  • -m <Driver File Name>
Note: Before specifying driver file name we have to copy the PPD file to /usr/share/cups/model/ path
[ravi@TechTutorials~]$ sudo /usr/sbin/cupsenable HYDPRINTER
Above command will enable the printer
Verify the printer status using below command
[ravi@TechTutorials~]$ sudo /usr/bin/lpstat -p HYDPRINTER  -l
Change the printer config to yes
[ravi@TechTutorials~]$ sudo /bin/sed -i 's/No/Yes/g' /etc/cups/printers.conf
Restart CUPS Service to effect the changes
[ravi@TechTutorials~]$ sudo /sbin/service cups restart
[ravi@TechTutorials~]$ sudo lpstat -o -t |grep HYDPRINTER
That’s it your printer is added successfully to CUPS Server.

No comments: