1827760 Members
2689 Online
109969 Solutions
New Discussion

Printing error message

 
Justin Glass
Occasional Contributor

Printing error message

I'm trying to test the printing capability and when I go to print I receive the error "lp: can't open default destination file". Can you tell me why I might be receiving this or what I can try to correct this error.

Thanks
4 REPLIES 4
Pete Randall
Outstanding Contributor

Re: Printing error message

You could try supplying a destination to your lp command with the -d option. Without one specified it's trying to print to the default and you apparently don't have one set.
You can check with lpstat -d.

Pete

Pete
S.K. Chan
Honored Contributor

Re: Printing error message

Take a look at file /usr/spool/lp/default. This file has the default printer name defined on the system. It needs to have the right permission/ownership, otherwise you would get the error you're seeing.
Perm= 644
ownership= lp:lp
Oleg Zieaev_1
Regular Advisor

Re: Printing error message

Hello.

You need default destination to be set up.
Pick a printer from /var/spool/lp/request or create printer queue of your choice from sam.
And then set your default destination to it:
lpadmin -dPRINTER_QUEUE_NAME
check with lpstat -d

Hope this helps.
Oleg
Professionals will prevail ...
Bill Hassell
Honored Contributor

Re: Printing error message

Actually, I would never set a default printer except on a simple single user workstation. The reason is that typical Unix servers have dozens to hundreds of users and the 'correct' printer is the closest one.

If users forget to include the -d option, the printout goes to the default printer leaving the user to wonder why nothing printer on their favorite printer...and they *ALWAYS* print the file again (and again, and again) before they figure out the problem.

You can fix this problem very easily: no default printer *AND* put this in every user's .profile:

export LPDEST=LPDESTisNOTsetup

Now, when anyone tries to print using lp without the -d option, they will get an error message something like:

No such printer: LPDESTisNOTsetup

rather than piling multiple copies of their print jobs on the poor default printer.


Bill Hassell, sysadmin