Setting Up printer using CUPS Command-Line Utilities on SOlaris 11.2
1. Become root
sam@apsol11sas25:~$ sudo su -
Enter your LAN Password:
Your password expires in 7 days. Please change it as soon as possible.
Oracle Corporation SunOS 5.11 11.2 June 2014
You have new mail.
2. How to Set Up Your Printing Environment
2.1. Ensure that the cups/scheduler and the cups/in-lpd SMF services are online.
root@apsol11sas25:~# svcs -a | grep cups/scheduler
online Nov_20 svc:/application/cups/scheduler:default
root@apsol11sas25:~# svcs -a | grep cups/in-lpd
disabled Nov_20 svc:/application/cups/in-lpd:default
2.2. If not running, enable these services
root@apsol11sas25:~# svcadm enable cups/in-lpd
root@apsol11sas25:~# svcs -a | grep cups/in-lpd
online 11:46:28 svc:/application/cups/in-lpd:default
2.3. Find out if the printer/cups/system-config-printer package is installed on your system.
root@apsol11sas25:~# pkg info print/cups/system-config-printer
Name: print/cups/system-config-printer
Summary: Print Manager for CUPS
Category: System/Administration and Configuration
State: Installed
Publisher: solaris
Version: 1.0.16
Build Release: 5.11
Branch: 0.175.2.0.0.26.0
Packaging Date: October 28, 2013 03:14:17 PM
Size: 2.69 MB
FMRI: pkg://solaris/print/cups/system-config-printer@1.0.16,5.11-0.175.2.0.0.26.0:20131028T151417Z
2.4. If not installed, install it
# pkg install print/cups/system-config-printer
2.5. list the print service enabled on your system
root@apsol11sas25:~# /usr/sbin/print-service -q
-bash: /usr/sbin/print-service: No such file or directory
root@apsol11sas25:~# print-service -q
-bash: print-service: command not found
3. Set Up a printer using the lpadmin Command
root@apsol11sas25:~# lpstat -d
no system default destination
root@apsol11sas25:~# lpadm
-bash: lpadm: command not found
root@apsol11sas25:~# ls -l /usr/sbin/lpadmin
-r-xr-xr-x 1 root bin 28068 Sep 22 16:59 /usr/sbin/lpadmin
root@apsol11sas25:~# /usr/sbin/lpadmin -p ^C
root@apsol11sas25:~# hp5593^C
root@apsol11sas25:~# ping hp5593
hp5593 is alive
root@apsol11sas25:~# nslookup hp5593
Server: 192.168.20.20
Address: 192.168.20.20#53
Name: hp5593.fhlmc.com
Address: 192.168.20.28
3.1 Use the lpadmin command with the -p option to add a printer to CUPS.
root@apsol11sas25:~# /usr/sbin/lpadmin -p hp5593 -E
-p ---> Specifies the name of the printer to add.
-E ---> Enables the destination and accepts jobs.
root@apsol11sas25:~# lpstat -d
no system default destination
3.2. Enable the printer to accept print requests and to print those requests.
root@apsol11sas25:~# cupsaccept hp5593
root@apsol11sas25:~# cupsenable hp5593
3.3. Verify that the printer is correctly configured
root@apsol11sas25:~# lpstat -p hp5593 -l
printer hp5593 is idle. enabled since November 25, 2014 11:51:11 AM EST
root@apsol11sas25:~# lpstat -d
no system default destination
root@apsol11sas25:~# lpstat -p hp5593
printer hp5593 is idle. enabled since November 25, 2014 11:51:11 AM EST
root@apsol11sas25:~# pwd
/root
root@apsol11sas25:~# cd /var/tmp
root@apsol11sas25:/var/tmp# cat >testprint
Testing printer from Sam to John.
If you see this page, please give it to John.
Thank you
Printed from apsol11sas25
root@apsol11sas25:/var/tmp# ls testprint
testprint
4. Test your print job
root@apsol11sas25:/var/tmp# lp testprint
lp: Error - no default destination available.
root@apsol11sas25:/var/tmp# lp -d hp5593 testprint
request id is hp5593-1 (1 file(s))
root@apsol11sas25:/var/tmp# lpstat
root@apsol11sas25:/var/tmp# lpstat -l
root@apsol11sas25:/var/tmp# lpstat -r
scheduler is running
root@apsol11sas25:/var/tmp# lpstat -t
scheduler is running
no system default destination
device for hp5593: ///dev/null
hp5593 accepting requests since November 25, 2014 11:58:32 AM EST
printer hp5593 is idle. enabled since November 25, 2014 11:58:32 AM EST
root@apsol11sas25:/var/tmp# man lpstat
Reformatting page. Please Wait... done
root@apsol11sas25:/var/tmp#
5. Set the system's default destination printer
root@apsol11sas25:/var/tmp# lpadmin -d hp5593
root@apsol11sas25:/var/tmp# lpstat -d
system default destination: hp5593
root@apsol11sas25:/var/tmp# ls -ltr
-rw-r--r-- 1 root root 128 Nov 25 11:57 testprint
root@apsol11sas25:/var/tmp# lp testprint
request id is hp5593-2 (1 file(s))
root@apsol11sas25:/var/tmp#
https://docs.oracle.com/cd/E23824_01/html/821-1451/gllmb.html#scrolltoc
https://docs.oracle.com/cd/E23824_01/html/821-1451/gllgm.html#scrolltoc