GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Install a Printer |
20200213 The basic command to install a printer and enable the queue, given an address for a known printer (F108) on a specific print server (http://vitellius.dcs.ktu.edu:631/printers/F108):
$ lpadmin -p F108 -v http://vitellius.dcs.ktu.edu:631/printers/F108 -E |
To find the publicly available broadcasting printers use
lpinfo's -v
option:
$ lpinfo -v network http network lpd network https file cups-brf:/ network ipps network ipp network beh network socket direct usb://HP/Photosmart%20B110%20series?serial=CN13J3S5MQ05J8&interface=1 direct hp:/usb/Photosmart_B110_series?serial=CN13J3S5MQ05J8 direct usb://Brother/HL-3040CN%20series?serial=000J9J16822 network smb direct hpfax network dnssd://Photosmart%20B110%20series%20%68C6%5D._pdl-datastream._tcp.local/ network socket://192.168.178.28:9100 network ipp://HP4C68C6.local:631/ipp/printer |
This list identifies the discovered printers and their URI. In this example two printers are connected via USB. One is a HP Photosmart B110 and the other is a Brother HL-3040CN. The HP printer is also available as a HP printer device (the entry with the hp: prefix).
The HP printer is also connected to the local network, either by Ethernet or WiFi and the three network entries identify alternative ways to connect to the printer via the network. The dnssd (Domain Name Service Service Discovery) is a mechanism for automatically configuring the discovered printer. The printer is also available directly through it's IP address, and specifcally connecting to port 9100. The ipp protocol is the Internet Printing Protocol which allows print jobs to be sent to the print server running locally here.
Set up the appropriate printer queue with a name of choice
(-p
) using the device URI identified from above
(-v
), and enable the printer and allow it to accept print
jobs (-E
):
$ lpadmin -p HL3040CN -v usb://Brother/HL-3040CN%20series?serial=000J9J168122 -E |
The PPD file will be expected to be found in /etc/cups/ppd/HL3040CN.ppd and can be installed using:
$ lpadmin -p lp5 -P Brother-HL-3040CN.PPD |
To print a test page:
$ lpr -P HL3040CN /usr/share/cups/data/testprint |
To add a printer with descriptive options:
$ lpadmin -p F108 \ -v dnssd://Brother%20HL-3040CN%20series._pdl-datastream._tcp.local/ \ -P /opt/brother/Printers/hl3040cn/cupswrapper/brother_hl3040cn_printer_en.ppd \ -L "Study" \ -D "Brother HL-3040CN" \ -E |