Lpr error no default destination

Hi,
  • Index
  • » Newbie Corner
  • » lpr: Error — no default destination available

#1 2007-01-17 01:10:09

vladuz976
Member
From: Venice, CA
Registered: 2005-11-04
Posts: 108

lpr: Error — no default destination available

Hi,

I set up CUPS via the web interface and I can print from graphical apps. From command line i cannot use lpr and lpq. I get

lpr: Error - no default destination available

Please, can somebody tell me where to set the default destination. I’ve searched the wiki and forums but haven’t found anything. This maybe a silly question for most users, but please just point me to where I can find the answer. I’ll be more than happy to rtfm if I only knew where start reading.

Thanks.

#2 2007-01-17 05:38:50

ploxiln
Member
Registered: 2006-10-27
Posts: 50

Re: lpr: Error — no default destination available

Interestingly enough, I had a similar problem just today. I was trying to share a printer from one linux system to the other, and once one edits /etc/cups/client.conf to include the hostname of the system sharing the printer, the printer should show up when one uses the lpq command… which just wasn’t happening, even if I opened my print server up to the world (temporarily). It gave me the exact same complaint it gave you. It seemed to just sort of fix itself after a while though (an hour after I gave up?), now the printer shows up when I issue the lpq command.

I set the same thing up months ago and didn’t experience a delay in operation… I wonder if it kicks in after a while for you too?

Maybe try setting that printer as the default with the cups web interface or somehow else?

So, in conclusion, I don’t have an explanation for you smile

#3 2007-01-18 12:10:24

Raniz
Member
From: Lund, Sweden
Registered: 2007-01-11
Posts: 14

Re: lpr: Error — no default destination available

go to http://localhost:631 and look for your printer. You should be able to set it to default there.

#4 2016-01-16 06:21:19

jwbales
Member
Registered: 2016-01-16
Posts: 1

Re: lpr: Error — no default destination available

To find the available printers, at a terminal type

lpstat -p -d

Then to pick one as the default lpd printer, type at the terminal

lpoptions -d <printer>

You can copy and paste the <printer> from the list given by lpstat -p -d

Then type

lpq

to see if the printer you selected is now the default.

#5 2016-01-16 07:06:38

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: lpr: Error — no default destination available

Hi jwbales,

thanks for a helpful first post. But seeing that the topic you replied is almost a decade old, it is unlikely to be helpful for the ones who started the thread.

Closing.

  • Home
  • Forum
  • Community Help: Check the Help Files, then come here to ask!
  • Technical
  • lpr: error — no default destination available.

  1. lpr: error — no default destination available.

    I’m setting up (or trying to), CUPs and SAMBA. Samba is installed and working, and most of CUPs is installed and working. My problem is I want setup printer sharing, so I need CUPs to play along with SAMBA. Well when I try to run any lpr / lp command I get the error no default destination available…

    linuxserver1:~ # cat /etc/hosts | lpr
    lpr: error — no default destination available.

    The printer is installed and working. I have printed a test page, so I’m more than sure it works.

    linuxserver1:~ # lpstat -v
    device for Epson600: parallel:/dev/lp0

    But I still can’t for some reason figure out how to setup a ‘default destination.’ I don’t even know what destination it wants! Does it need the destination of the printer: i.e: /dev/lp0. Does it need the destination of the spool directory?.. i.e: /var/spool/. I have tried doing lpadmin -d [Epson600], but it has not helped..

    So any help you guys can provide would be loved.

    cheers


  2. Ok I got SAMBA and CUPS working together. My only problem now is when ever lpr is called I get an error message «no default destination availibal».

    Im guessing this is the default destination of the printer… How would I go about configuring this? I’ve checked CUPS website (localhost:601 I believe), and I have no option to set the printer as default. =.

    So any help would be loved…

    Also can anyone explain lp and lrp… They seem to be differnt protocols, because from lp I can print locally, but not from lrp… =. I’m so lost and confoozed.


  3. I believe you need to define a print queue.

    Have a look at http://www.linuxprinting.org/piperma…q2/000547.html



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules

View previous topic :: View next topic  
Author Message
jansk
Apprentice
Apprentice

Joined: 09 Aug 2004
Posts: 164

PostPosted: Wed Apr 18, 2007 7:17 am    Post subject: [SOLVED] lpr: Error — no default destination available. Reply with quote

Hello,

I set up my network printer with CUPS. It works fine from Firefox, Acrobat Reader etc. but it doesn’t work from command line.

I get the following message:

Code:
 

$ lpr

lpr: Error — no default destination available.

$ lpstat -hlocalhost -p -d

printer EPSON_LP-8700PS3_133.5.123.11 is idle.  enabled since Tue 27 Mar 2007 12:39:52 PM JST

no system default destination

How to set «default destination» ?

My /etc/printcap is as follows:

Code:

# This file was automatically generated by cupsd(8) from the

# /etc/cups/printers.conf file.  All changes to this file

# will be lost.

EPSON_LP-8700PS3_133.5.123.11|EPSON LP-8700PS3:rm=localhost:rp=EPSON_LP-8700PS3_133.5.123.11:

Jan

Last edited by jansk on Thu Apr 19, 2007 1:11 am; edited 1 time in total

Back to top

View user's profile Send private message

wynn
Advocate
Advocate

Joined: 01 Apr 2005
Posts: 2421
Location: UK

PostPosted: Wed Apr 18, 2007 9:49 am    Post subject: Reply with quote

Go to http://localhost:631/printers and click on «Set As Default» for the printer.
_________________
The avatar is jorma, a «duck» from «Elephants Dream»: the film and all the production materials have been made available under a Creative Commons Attribution 2.5 License, see orange.blender.org for details.
Back to top

View user's profile Send private message

jansk
Apprentice
Apprentice

Joined: 09 Aug 2004
Posts: 164

PostPosted: Thu Apr 19, 2007 1:11 am    Post subject: Reply with quote

A good one ;)

Thanks, I overlook the «Set As Default» button … instead I was hacking my file system upside down :oops:

Jan

Back to top

View user's profile Send private message

wynn
Advocate
Advocate

Joined: 01 Apr 2005
Posts: 2421
Location: UK

PostPosted: Thu Apr 19, 2007 8:25 am    Post subject: Reply with quote

I find I only see things that I know are there 8O
_________________
The avatar is jorma, a «duck» from «Elephants Dream»: the film and all the production materials have been made available under a Creative Commons Attribution 2.5 License, see orange.blender.org for details.
Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

108.4 Managing Printers and Printing[edit | edit source]

Candidates should be able to manage printer queues and user print jobs using CUPS and the LPD compatibility interface

Key Knowledge Areas

  • Basic CUPS configuration (for local and remote printers).
  • Manage user print queues.
  • Troubleshoot general printing problems.
  • Add and remove jobs from configured printer queues.

Introducing CUPS[edit | edit source]

CUPS (Common Unix Print System) is the standard print system on Linux. The cups server is cupsd; it listens on port 631 and accepts print jobs using IPP (the Internet Printing Protocol). IPP is layered over HTTP, in the sense that an IPP request is an HTTP request with a specific type of content.

Ict-innovation-LPI-Fig-108-4 1.png

Illustration 108.4-1: CUPS Printing System

The CUPS server handles printer queue management and also provides a web server (also on port 631) that supports a browser-based configuration interface allowing the addition and deletion of printers, printer queue management, and so on.

Ict-innovation-LPI-Fig-108-4 2.png

Figure 108.4-2: CUPS Web Interface: Home Page

CUPS filters

The internal work-flow within cups can be relatively complex:

Ict-innovation-LPI-Fig-108-4 3.png

Figure 108.4-3: Linux Printing Architecture

The front-end of CUPS is the actual server that handles the queuing of print jobs and provides the web-based configuration interface. Beyond that, at the heart of the work-flow are the filters, which provide format conversion from the initial input file (plain text, jpeg image, etc) to the language understood by the actual printer. These filters are based on Ghostscript (a GNU project). They consult PPD (Postscript Printer Description) files which specify the printer’s capabilities. The filters are found in (for example) /usr/share/ghostscript.

Ghostscript can also be invoked from the command line with the name gs. This command takes postscript or PDF files as input and generates an output file for a specific printer type. It has a database of printer drivers it can handle (this list is reasonably up to date, for example many USB printers are supported) and converts the postscript directly into PCL for these known models. Run the command gs -h to see a list of supported devices:

# gs -h

GPL Ghostscript 8.71 (2010-02-10)

Copyright (C) 2010 Artifex Software, Inc. All rights reserved.

Usage: gs [switches] [file1.ps file2.ps …]

Most frequently used switches: (you can use # in place of =)

-dNOPAUSE no pause after page | -q `quiet’, fewer messages

-g<width>x<height> page size in pixels | -r<res> pixels/inch resolution

-sDEVICE=<devname> select device | -dBATCH exit after last file

-sOutputFile=<file> select output file: — for stdout, |command for pipe,

embed %d or %ld for page #

Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PostScriptLevel3 PDF

Default output device: x11alpha

Available devices:

alc1900 alc2000 alc4000 alc4100 alc8500 alc8600 alc9100 ap3250 appledmp

atx23 atx24 atx38 bbox bit bitcmyk bitrgb bitrgbtags bj10e bj10v bj10vh

bj200 bjc600 bjc800 bjc880j bjccmyk bjccolor bjcgray bjcmono bmp16 bmp16m

bmp256 bmp32b bmpgray bmpmono bmpsep1 bmpsep8 ccr cdeskjet cdj1600 cdj500

… many lines deleted …

CUPS back-ends

CUPS supports a variety of back-ends. The term back-end refers to the technology or protocol used to connect to the printer. The table below gives some examples:

Table: CUPS Back-end Technologies

Back-end URI Syntax Example
Parallel port parallel:/dev/lpx parallel:/dev/lp0
USB usb://make/model?serial=number usb://hp/officejet123?serial=108442
ipp ipp://host/printers/queue ipp://neptune/printers/xerox1
LPD lpd://host/queue lpd://neptune/xerox1
socket socket://host:port socket://neptune:9100
CIFS smb://user:password@workgroup/host/share

CUPS printers can be added using the web-based interface. The figure below shows two of several screens in this sequence:

Ict-innovation-LPI-Fig-108-4 4.png

Figure 108.4-4: Adding a Printer — I

Ict-innovation-LPI-Fig-108-4 5.png

Figure 108.4-5: Adding a Printer — II

Printers can also be assigned to classes. This is mainly useful on heavy duty print servers that have several printers of the same type connected. Users send print jobs to a class; CUPS will print them on the first printer that becomes available.

Legacy commands for printing[edit | edit source]

CUPS replaces two earlier printing systems used in UNIX and Linux. One comes from System V Unix, and the other comes from BSD (Berkeley Software Distribution). These two systems were principally intended for printing of plain text files from the command line (and not, for example, printing of office documents with embedded images from a graphical application such as Open Office). The two systems, whilst conceptually similar, used different commands, different configuration files, and a different protocol to talk to the print server.

For backward compatibility, CUPS provides «work-alike» versions of many of these command-line tools. These include:

Command Description
lp, lpr submit files for printing
lpq print printer queue status
lprm remove a queued print job
accept Allow jobs to be sent to a print queue
reject Prevent jobs from being sent to a print queue
cupsenable Allow jobs to be sent from a queue to a printer
cupsdisable Stop jobs being sent from the queue to the printer
lpstat Show the status of the CUPS printer queues
lpadmin Configure cups printers and classes

When using CUPS, these command submit jobs to the CUPS server which performs its usual filtering and back-end processing.

lp and lpr

The lpr and lp utilities are used to submit jobs to a printer. Note that they use different command options. For example lpr uses the -P flag to specify the printer, lp uses the -d flag.

lpq

A user can monitor the status of print queues with lpq. In the example below, demo-1 is the name of the printer.

# lpr -Pdemo-1 anaconda-ks.cfg

# lpq -Pdemo-1

demo-1 is not ready

Rank Owner Job File(s) Total Size

1st root 4 install.log 39936 bytes

2nd root 5 anaconda-ks.cfg 1024 bytes

lprm

The lprm command is used to delete jobs from the print queue. In the example below we delete job 4 from the demo-1 print queue then redisplay the queue:

# lprm -Pdemo-1 4

# lpq -Pdemo-1

demo-1 is not ready

Rank Owner Job File(s) Total Size

1st root 5 anaconda-ks.cfg 1024 bytes

lpstat

lpstat displays status information about the current classes, jobs, and printers. When run with no arguments, lpstat will list jobs queued by the current user.

Example:

# lpstat -t

scheduler is running

no system default destination

device for demo-1: parallel:/dev/lp0

device for demo-2: ipp://printhost/ipp

demo-1 accepting requests since Sun 26 Sep 2010 12:38:10 PM BST

demo-2 accepting requests since Sun 26 Sep 2010 12:34:53 PM BST

printer demo-1 disabled since Sun 26 Sep 2010 12:38:10 PM BST —

Paused

printer demo-2 is idle. enabled since Sun 26 Sep 2010 12:34:53 PM BST

demo-1-5 root 1024 Sun 26 Sep 2010 12:39:30 PM BST

# lpstat

demo-1-5 root 1024 Sun 26 Sep 2010 12:39:30 PM BST

cupsenable and cupsdisable

These commands are used to enable and disable specified printer queues. cupsdisable stops jobs being taken from the queue and sent to the printer. It does not prevent new jobs being sent to the queue. cupsenable re-starts the servicing of the queue.

accept and reject

These commands are used to enable and disable the filling of specified printer queues. In the example below we use reject to disable the demo-1 queue, then attempt to print a file to it. We then re-enable the printer, and successfully send a job to the queue:

# reject demo-1

# lpr -Pdemo-1 scsconfig.log

lpr: Destination «demo-1» is not accepting jobs.

# accept demo-1

# lpr -Pdemo-1 scsconfig.log

lpadmin

The lpadmin command performs a variety of administrative operations on CUPS printers. For example it can be used to set the default printer. In the command sequence shown below there is initially do default destination set. After running lpadmin, we can print to the default printer by using lpr without specifying a printer name:

# lpr install.log

lpr: Error — no default destination available.

# lpadmin -d demo-1

# lpr install.log

lpadmin can also be used to delete CUPS printers. In the example below we first list the available queues, then use lpadmin to remove one of them, then list the queues again:

# lpstat -a

demo-1 accepting requests since Sun 26 Sep 2010 12:38:10 PM BST

demo-2 accepting requests since Sun 26 Sep 2010 12:34:53 PM BST

# lpadmin -x demo-1

# lpstat -a

demo-2 accepting requests since Sun 26 Sep 2010 12:34:53 PM BST


The following is a partial list of the used files, terms and utilities:

  • CUPS configuration files, tools and utilities
  • /etc/cups
  • lpd legacy interface (lpr, lprm, lpq)

Previous Chapter | Next Chapter

Forum rules
There are no such things as «stupid» questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.

complimentarygrowler

Printing or saving a mp3 list [Solved]

I’ve pretty much do all of my computing with Linux Mint 10 (32bit) these days. But back in my windows days I never explored how to save a list of mp3 files or print them. Here’s what I’m trying to do. I have mp3s in folders in the Music directory of my home directory. Is there a way in Nautilus to save these in a text file? Is there a way to print the list? Is there a way to save the list or print it in the terminal? Thanks

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.

Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

altair4

Level 20
Level 20
Posts: 11021
Joined: Tue Feb 03, 2009 10:27 am

Re: Printing or saving a mp3 list

Post

by altair4 » Sun May 29, 2011 8:04 am

One way to create a file:

Code: Select all

ls -1 /home/username/Music/*.mp3 > mp3list.txt

That «-1» is a «minus one» BTW. It will produce a list of one line per mp3.

To print the list directly:

Code: Select all

ls -1 /home/username/Music/*.mp3 | lpr

Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

User avatar

Pilosopong Tasyo

Level 6
Level 6
Posts: 1432
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: Printing or saving a mp3 list

Post

by Pilosopong Tasyo » Sun May 29, 2011 11:11 am

complimentarygrowler wrote:…I have mp3s in folders in the Music directory of my home directory…

Since you have folders within the Music folder, you can use the following variation to compile everything in one go and to add a bit of spacing between folders:

Save as a text file in the home folder:

Code: Select all

for ARTIST in ~/Music/* ; do echo Content of `basename "$ARTIST"` >> ~/mp3list.txt ; ls -1 "$ARTIST" >> ~/mp3list.txt ; echo >> ~/mp3list.txt ; done

Note the commands above are supposed to be written/copy-pasted as a single line in Terminal.

o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].

complimentarygrowler

Re: Printing or saving a mp3 list

Post

by complimentarygrowler » Sun May 29, 2011 1:20 pm

I tried the print command and got the following error message:
lpr: Error — no default destination available.

I was able to create the mp3 text file with the following command:
ls -1 /home/username/Music/*.mp3 > mp3list.txt

I did encounter a couple of problems.

1)whenever I try to access a folder that has a space in the name, it won’t work. For example, I created a folder called dell dj. I had to change the folder name to delldj
2)I used the ls -1 /home/username/Music/*.mp3 > mp3list.txt and slightly changed it by going farther into the folder: ls -1 /home/username/Music/delldj/*.mp3 > mp3list.txt The resulting text file only listed half of the contents of delldj

I was able to get the command: echo Content of `basename «$ARTIST»` >> ~/mp3list.txt ; ls -1 «$ARTIST» >> ~/mp3list.txt ; echo >> ~/mp3list.tx to execute but it didn’t print out what I was requesting.

DrHu

Re: Printing or saving a mp3 list

Post

by DrHu » Sun May 29, 2011 1:35 pm

complimentarygrowler wrote:1)whenever I try to access a folder that has a space in the name, it won’t work. For example, I created a folder called dell dj. I had to change the folder name to delldj

I think the xtree derivatives should be able to handle that; spaces in filenames

  • That is a function of the OS, all OS’s have similar functions, a separator character for directories or other file types
    windows, it is the
    OS-X, it is the :
    Linux, it is the /

—special characters that are not allowed for a normal filename as the first character or between filename parts/paths
http://www.tuxfiles.org/linuxhelp/weirdchars.html
—I usually use quoting when searching for file name patterns that might include spaces

If you really want to manage your list of files and not just for this one time, you might either use a better file manager, such as Gnome commander or Midnight commander; both of which provide better filtering than nautilus ( a simple file manager)
http://en.wikipedia.org/wiki/GNOME_Commander
http://en.wikipedia.org/wiki/Midnight_Commander

Or you could install some tagging software to collect the data (tags) for your music files
http://www.linux.com/archive/feature/120060
http://www.linux.com/archive/feed/153034
http://linuxappfinder.com/multimedia/audiotageditors
—your music player might have enough features to create lists for you, or if it is a file manager, you simply need to find all the *.mp3 files, and save that list; if your file manager can handle that, most should be able to, however there are better file managers available to you..
http://www.han.de/~werner/ytree.html
http://www.unixtree.org/
—an xtree derivative, xtree file managers of which Midnight commander and others share its file pattern aggregation functions, xtree being the original (dos/windows program)
http://www.xtreefanpage.org/x64linux.htm

wyrdoak

Level 6
Level 6
Posts: 1305
Joined: Thu May 19, 2011 1:32 pm
Location: USA

Re: Printing or saving a mp3 list

Post

by wyrdoak » Sun May 29, 2011 1:49 pm

Maybe this will help if I link something in wine I would have to do this.

\home\username\Music\dell dj\*.mp3

-Dell Mini Inspiron 910 Netbook-Atom CPU-N270-1.60ghz; 16gbs mini ePCI PATA SSD
15GB RAM- 1gbs-(LinixMint-19.3: LMDE)

altair4

Level 20
Level 20
Posts: 11021
Joined: Tue Feb 03, 2009 10:27 am

Re: Printing or saving a mp3 list

Post

by altair4 » Sun May 29, 2011 2:07 pm

Code: Select all

find /home/username/Music -name '*.mp3'

Code: Select all

find /home/username/Music -name '*.mp3' > mp3list.txt

Code: Select all

find /home/username/Music -name '*.mp3' | lpr

If you have spaces in the parent directory put » » around it:

Code: Select all

find /home/username/"My Music" -name '*.mp3'

I tried the print command and got the following error message:
lpr: Error — no default destination available.

Sounds like you don’t have a default printer set up:
Menu > Administration > Printing > Right click a printer > Set as Default

Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

User avatar

Pilosopong Tasyo

Level 6
Level 6
Posts: 1432
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: Printing or saving a mp3 list

Post

by Pilosopong Tasyo » Sun May 29, 2011 11:25 pm

complimentarygrowler wrote:I was able to get the command: echo Content of `basename «$ARTIST»` >> ~/mp3list.txt ; ls -1 «$ARTIST» >> ~/mp3list.txt ; echo >> ~/mp3list.tx to execute but it didn’t print out what I was requesting.

Just open the text file in Open/LibreOffice or GEdit (or whatever GUI-based text editor that you use) and print from there.

Edit: Before I wrote the commands in an earlier post, I tried it on my Music folder. Like you, my Music folder have sub-folders (organized by artist/album) and a lot of those folders have spaces in the names. Below that level are the actual music files (also have spaces in the filenames). So the commands I posted are guaranteed to work as expected. Now if some of your sub-folders go several levels deep, that’s a different story.

o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].

complimentarygrowler

Re: Printing or saving a mp3 list (Solved)

Post

by complimentarygrowler » Mon May 30, 2011 4:49 pm

This page is so loaded with good information, I’m going to save it for future reference. I especially appreciate the information on putting ; ; around a folder in the terminal. Thanks to all.

Понравилась статья? Поделить с друзьями:
  • Lpksetup exe ошибка
  • Linux проверка файловой системы на ошибки
  • Lp2dx9 exe lost planet 2 как исправить
  • Linux проверка диска на ошибки fsck
  • Linux проверка ssd диска на ошибки