1

I need to install a network printer using the command line. This is for automated installation and reconfiguration with CFEngine on dozens of PCs.

OS: Ubuntu 14.04 LTS 64-bit. Printer model: HP LaserJet P3010.

Using the GUI, with "system-config-printer", I can set up my printer and print. The printer model is known by CUPS, no need to install a driver manually.

Ideally, I would like to use a command such as this:

lpadmin -p 'myprintername' -v 'smb://myserver/myprinter' -m 'HP LaserJet P3010 Series Postscript (recommended)' -P '...../hp-laserjet_p3010_series-ps.ppd' -L 'Printer location' -o 'HPOption_Duplexer/Duplex Unit=True' -E

The problem is that the "...../hp-laserjet_p3010_series-ps.ppd" PPD file is a fiction - There are no PPD files as such installed on Ubuntu.

From what I understand, CUPS has its own database from which it can generate the PPD files. The "system-config-printer" command somehow generates a PPD file in "/etc/cups/ppd" for the printer. Or maybe it retrieves the data from the Samba/CUPS server.

How can I install this printer from the command line ? Is it possible to generate the PPD file the same way as "system-config-printer" does, but using the command line ?

  • complete guess, but there are some python scripts provided by the python-cupshelpers package - maybe that's where the magic happens? – steeldriver Feb 18 '16 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.