How do I install and config a printer from the CLI?
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I install and config a printer from the CLI?
I'm using debian 3.0, I have an old HPLJ series II printer. I am connecting through a paralell port.
I don't even have a /etc/printcap file. I don't need the printer to be used, or configured, from the network.
I tried using CUPS with MEPIS, which I had installed previously, it didn't work at all, the printer just kept feeding pages. I also have windows 2k installed on another partition, the printer works great from windows.
Anyway, I would like to install the printer, at least once, just from the command line.
I tried google, but didn't really find what I wanted, if anybody could point me to a web-site that give such straight forward instructions, that would also be helpful.
I use CUPS for my HP LaserJet 5P printer and it works pretty well. To configure it from the command line you can install CUPS and any dependancies, then configure it through lpadmin. The command I use is something like:
and that's it. After it's set up and you type in "lpstat -t" you should see the printer in the listing.
That almost worked. Here is my output:
# lpstat -t
scheduler is running
system default destination: LaserJet
device for LaserJet: parallel:/dev/lp0
LaserJet accepting requests since Jan 01 00:00
printer LaserJet is idle. enabled since Jan 01 00:00
That looks about right, but it doesn't work. Whenever I try to print something, I get a message that the job is going to the printer, but nothing happens - the printer doesn't even try.
Allright. Next thing to check is if it's getting to the spooler okay. Try an "lp <filename>" with a text file then run "lpstat -t" and check if it gives you any errors. I believe it also dumps errors in the /var/log(/cups?) somewhere.
Another important thing to note is the permission of the /dev/lp port in question. For instance, on Mandrake 8.2 I need to reconfigure PAM so that the group my users are assigned to can access it. "chmod 0666 /dev/lp0" for testing, and list it after you've attempted printing to it to make sure it's still permissioned rw-rw-rw-.
Outside permissioning it usually "just works" on Mandrake and Gentoo for me, but I don't have any experience with straight Debian installs. There might be something specific that Deb needs aside from what I'm used to.
Perhaps Apsfilter would suit your needs better than CUPS. I've used Apsfilter myself before I discovered CUPS and it served me well at the time. Here's an article that introduces Apsfilter, in case you're interested:
# lp deb_notes.txt
lp: unable to print file: server-error-not-accepting-jobs
# lpstat -t
scheduler is running
system default destination: LaserJet
device for LaserJet: parallel:/dev/lp0
LaserJet not accepting requests since Jan 01 00:00 -
Rejecting Jobs
printer LaserJet is idle. enabled since Jan 01 00:00
Rejecting Jobs
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.