Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
1
answers
174
views
Flatpak-installed Calibre: cannot find ebook-convert command
On my Linux Mint 22 Cinnamon (Wilma) based on Ubuntu 24.04 LTS (Noble). I ended up installing Calibre in spite my initial dislike, via Flatpak: ```none $ flatpak install flathub com.calibre_ebook.calibre ``` The installation was successful, **but the the shell can't find the `ebook-convert` command*...
On my Linux Mint 22 Cinnamon (Wilma) based on Ubuntu 24.04 LTS (Noble).
I ended up installing Calibre in spite my initial dislike, via Flatpak:
$ flatpak install flathub com.calibre_ebook.calibre
The installation was successful, **but the the shell can't find the ebook-convert
command** (official manual page link ).
***
Reasoning about choosing Flatpak version:
At this point of time, reading upon the changelog here: https://calibre-ebook.com/whats-new
It is obvious the developer(s) are very active. The packaged version is Release: 7.6 [01 Mar, 2024], whereas the Flatpak version is the latest available (Release: 7.20 [18 Oct, 2024]).
In spite, I originally have thought I would only use the ebook conversion command, this software might *surprise me*,..
Vlastimil Burián
(30515 rep)
Oct 21, 2024, 08:06 PM
• Last activity: Oct 22, 2024, 06:52 AM
1
votes
1
answers
267
views
How to cat the first page of an epub file?
epubcat book.epub 1 3 # outputs plain text of pages 1 through 3 I don’t know if epubs have the concept of “pages.” If not, perhaps we can say each 400 chars are a page? A general solution that works for other ebook formats is better (mobi, azw3, etc). My own thoughts are currently on first convertin...
epubcat book.epub 1 3
# outputs plain text of pages 1 through 3
I don’t know if epubs have the concept of “pages.” If not, perhaps we can say each 400 chars are a page?
A general solution that works for other ebook formats is better (mobi, azw3, etc).
My own thoughts are currently on first converting the book to text via ebook-convert or pandoc and then extracting the needed amount, but this seems awfully inefficient as I intend to only get a little of the beginning of the content.
You can download an example file that can be used for testing [here](http://82.102.11.148:8080//tmp/Time%20to%20Put%20Your%20Galleons%20Where%20Your%20Mouth%20Is%20-%20Tsume%20Yuki.epub) .
HappyFace
(1694 rep)
Apr 10, 2020, 09:32 AM
• Last activity: May 5, 2022, 11:46 PM
4
votes
1
answers
4438
views
Convert EPUB to TXT and preserve original formatting
I have a programming book in EPUB format and I'm trying to convert it to TXT. For that I'm using the utility **ebook-convert** from **calibre**. The problem is that the standard usage: ebook-convert book.epub book.txt removes indentation in source code samples. E.g. a sample in the book looks so: cl...
I have a programming book in EPUB format and I'm trying to convert it to TXT.
For that I'm using the utility **ebook-convert** from **calibre**.
The problem is that the standard usage:
ebook-convert book.epub book.txt
removes indentation in source code samples.
E.g. a sample in the book looks so:
class A {
private int a;
}
But in the resulted TXT:
class A {
private int a;
}
After reading the utility's man page I've tried the following options:
--keep-ligatures
--pretty-print
--change-justification=original
but with no result. How to achieve it?
ka3ak
(1275 rep)
May 2, 2021, 10:15 AM
• Last activity: May 2, 2021, 10:50 AM
1
votes
1
answers
315
views
calibre does not start - Python error _Py_FatalErrorFunc
### Background ### Debian testing (bullseye) kernel 5.9.0, KDE, calibre 5.5.0 ### Symptoms ### Calibre does not start, not even its GUI appears. Console shows a Python-related error message about `_Py_FatalErrorFunc`.
### Background ###
Debian testing (bullseye) kernel 5.9.0, KDE, calibre 5.5.0
### Symptoms ###
Calibre does not start, not even its GUI appears. Console shows a Python-related error message about
_Py_FatalErrorFunc
.
likewise
(690 rep)
Nov 26, 2020, 12:20 PM
• Last activity: Nov 27, 2020, 06:51 AM
8
votes
2
answers
7459
views
How can I highlight text in Calibre?
according to a 4 year-old forum entry at Calibre, they started working on the feature of being able to highlight text, 4 years ago. Does anyone know how if it is implemented yet and how to use it?
according to a 4 year-old forum entry at Calibre, they started working on the feature of being able to highlight text, 4 years ago. Does anyone know how if it is implemented yet and how to use it?
user46399
Oct 30, 2013, 09:16 AM
• Last activity: Oct 10, 2020, 08:06 AM
0
votes
1
answers
1228
views
How to specify output file name using piping?
I am using find to return the list of files from a directory and its subdirectories: find $directory -type f -name "*.epub" Then I want to use a command that requires the input and output filenames to be specified: ebook-convert input.epub output.txt I want to convert each `.epub` to `.txt` such tha...
I am using find to return the list of files from a directory and its subdirectories:
find $directory -type f -name "*.epub"
Then I want to use a command that requires the input and output filenames to be specified:
ebook-convert input.epub output.txt
I want to convert each
.epub
to .txt
such that the output is stored in the same directory/subdirectory as the input. Simple piping does not work.
find $directory -type f -name "*.epub" | ebook-convert
How do I do this?
user199046
Aug 19, 2019, 09:11 AM
• Last activity: Aug 19, 2019, 09:28 AM
1
votes
2
answers
323
views
Mass folder name correction - Calibre
I allowed Calibre access to my Library and it decided to change all my folder names adding (123) after every folder. (Replace 123 with random numbers.) What would be best command to use on Linux (Debian) terminal to remove all " (???)" strings from folder names?
I allowed Calibre access to my Library and it decided to change all my folder names adding (123) after every folder. (Replace 123 with random numbers.)
What would be best command to use on Linux (Debian) terminal to remove all " (???)" strings from folder names?
SamTzu
(81 rep)
Jul 4, 2019, 12:13 PM
• Last activity: Jul 18, 2019, 01:20 PM
2
votes
1
answers
1637
views
How to convert PDF to e pub in a fixed layout in Calibre
I am trying to use [Calibre][1] to convert a PDF file to Epub format with a fixed layout, but I am not able to convert it. Can somebody tell me the steps to convert in a fixed layout in Calibre? [1]: https://calibre-ebook.com/help
I am trying to use Calibre to convert a PDF file to Epub format with a fixed layout, but I am not able to convert it. Can somebody tell me the steps to convert in a fixed layout in Calibre?
mohan rathour
(121 rep)
May 28, 2019, 07:53 AM
• Last activity: May 31, 2019, 06:38 PM
2
votes
1
answers
2261
views
ebook-convert for all .epub files in the folder
This code converts epub file to txt file: ebook-convert "book.epub" "book.txt" How can I use it to convert all .epub files in the directory? I am using Ubuntu. ### Code from os import listdir, rename from os.path import isfile, join import subprocess # return name of file to be kept after conversion...
This code converts epub file to txt file:
ebook-convert "book.epub" "book.txt"
How can I use it to convert all .epub files in the directory?
I am using Ubuntu.
### Code
from os import listdir, rename
from os.path import isfile, join
import subprocess
# return name of file to be kept after conversion.
# we are just changing the extension. azw3 here.
def get_final_filename(f):
f = f.split(".")
filename = ".".join(f[0:-1])
processed_file_name = filename+".azw3"
return processed_file_name
# return file extension. pdf or epub or mobi
def get_file_extension(f):
return f.split(".")[-1]
# list of extensions that needs to be ignored.
ignored_extensions = ["pdf"]
# here all the downloaded files are kept
mypath = "/home/user/Downloads/ebooks/"
# path where converted files are stored
mypath_converted = "/home/user/Downloads/ebooks/kindle/"
# path where processed files will be moved to, clearing the downloaded folder
mypath_processed = "/home/user/Downloads/ebooks/processed/"
raw_files = [f for f in listdir(mypath) if isfile(join(mypath, f))]
converted_files = [f for f in listdir(mypath_converted) if isfile(join(mypath_converted, f))]
for f in raw_files:
final_file_name = get_final_filename(f)
extension = get_file_extension(f)
if final_file_name not in converted_files and extension not in ignored_extensions:
print("Converting : "+f)
try:
subprocess.call(["ebook-convert",mypath+f,mypath_converted+final_file_name])
s = rename(mypath+f, mypath_processed+f)
print(s)
except Exception as e:
print(e)
else:
print("Already exists : "+final_file_name)
silver
(61 rep)
Mar 9, 2019, 03:07 PM
• Last activity: Mar 9, 2019, 10:09 PM
2
votes
2
answers
3754
views
Using calibre from the command line
Using calibre from the command line, in debian testing, how can I insert a tag with the syntax being ebook-meta ebook_file --tags rhubarb but for a range of files, but all by the same author so just need the tag of his/her name? This is used for indexing and sorting out books on a Kindle.
Using calibre from the command line, in debian testing, how can I insert a tag with the syntax being
ebook-meta ebook_file --tags rhubarb
but for a range of files, but all by the same author so just need the tag of his/her name?
This is used for indexing and sorting out books on a Kindle.
boudiccas
(393 rep)
Sep 1, 2013, 04:31 AM
• Last activity: Nov 20, 2018, 10:27 PM
4
votes
0
answers
523
views
firejail: child-process not sandboxed?
As far as the sandbox **"firejail"** is concerned I´ve encountered a phenomenon which isn´t completely clear to me. My understanding has always been that whenever I start a programm/process in **firejail** that process is sandboxed. Fine, that´s clear. I was also of the opinion that w...
As far as the sandbox **"firejail"** is concerned I´ve encountered a phenomenon which isn´t completely clear to me.
My understanding has always been that whenever I start a programm/process in **firejail** that process is sandboxed.
Fine, that´s clear.
I was also of the opinion that whenever that sandboxed process triggers another process that one is by default sandboxed, too.
This is the case e.g. when doing this:
*
"firejail thunderbird"
* and then clicking on a link within a mail.
So (in my case) **firefox**, which
is my default browser, opens up and displays the website the link is referring to. Plus: *firefox is sandboxed, too*. I think this is
what it should be like.
But:
whenever I statrt **calibre** with *"firejail calibre"
*, that one is sandboxed. O.K. That´s fine too.
Now for the tricky part: When trying to open a pdf-file within the sandoxed calibre my default pdf-reader (**evince**) fires up but ***isn´t sandboxed***.
*"firejail --tree"
* doesn´t list it, nor does **firetools**.
I also can shutdown calibre and evince (displaying) the pdf-file remains open.
Can you tell me anything about that phenomenon?
Tnx a lot in advance.
Rosika
Rosika
(151 rep)
Jul 26, 2018, 12:59 PM
• Last activity: Jul 27, 2018, 09:36 AM
0
votes
1
answers
87
views
Is a local directory that has rwx permissions for all users vulnerable to attacks?
I'm just learning Unix and noticed my Calibre Library is set to `drwxrwxrwx`. I read that changing it's permissions will cause errors. I always add reputable files to the database, but it seems like a bad idea to have a database with open permissions. Do I have any basis to worry about?
I'm just learning Unix and noticed my Calibre Library is set to
drwxrwxrwx
.
I read that changing it's permissions will cause errors. I always add reputable files to the database, but it seems like a bad idea to have a database with open permissions.
Do I have any basis to worry about?
Nate Chavin
(1 rep)
Mar 22, 2018, 09:22 AM
• Last activity: Mar 22, 2018, 10:45 AM
1
votes
1
answers
1950
views
generate html table of content from multiple html files
This is not specifically a Linux question. But I was wondering if I can get this done in BASH. I have multiple HTML files in a folder and I want to generate a HTML table of content. So for *file1.html and file2.html*, I want to generate a file like this : Table of Contents file1 file2 The process is...
This is not specifically a Linux question. But I was wondering if I can get this done in BASH. I have multiple HTML files in a folder and I want to generate a HTML table of content. So for *file1.html and file2.html*, I want to generate a file like this :
Table of Contents
file1
file2
Joenikushimi
(23 rep)
Nov 8, 2017, 03:49 PM
• Last activity: Nov 9, 2017, 03:16 AM
1
votes
1
answers
298
views
calibre opds error 403 on the epub file
I'm trying to use calibre2opds to put my library on my server (fedora21). Everything works fine, I can navigate, until I want to download an epub. I get en error 403: You don't have permission to access /Anonyme/Le Livre Sans Nom (41)/Le Livre Sans Nom - Anonyme.epub on this server. I access the ser...
I'm trying to use calibre2opds to put my library on my server (fedora21). Everything works fine, I can navigate, until I want to download an epub.
I get en error 403:
You don't have permission to access /Anonyme/Le Livre Sans Nom (41)/Le Livre Sans Nom - Anonyme.epub on this server.
I access the server by 192.168.1.21/calibre. Calibre2ops put everything in
/mnt/Sardaukar/web/calibre
The HTML files are put by calibre2opds in
/mnt/Sardaukar/web/calibre/_catalog
and the actual epubs in, for instance
/mnt/Sardaukar/web/calibre/Anonyme/Le Livre Sans Nom (41)/Le Livre Sans Nom - Anonyme.epub
and the httpd file looks like
Alias /calibre /mnt/Sardaukar/web/calibre/_catalog
AllowOverride All
Options Indexes FollowSymLinks
Require all granted
I did it before, even with an .htaccess and it worked before, but now, I have no idea what is wrong. The permissions on /mnt/Sardaukar/web/calibre are 770, and chown by me:www-users
After more research, I found in the error log:
[Mon Jun 22 21:06:59.774348 2015] [authz_core:error] [pid 10805] [client 192.168.1.5:51992] AH01630: client denied by server configuration: /var/www/html/Anonyme, referer: http://192.168.1.21/calibre/book_0
>>>/book_41.html
Why does it try to read the epub in
/var/www/html
??
Napseis
(153 rep)
Jun 21, 2015, 07:59 PM
• Last activity: Jun 20, 2016, 11:09 AM
3
votes
0
answers
860
views
How to convert this chm file to pdf?
I want to convert [a chm file][1] to a pdf file. Calibre's command ebook-convert `ebook-convert 1.chm 1.pdf` only converts the first 7 pages of the chm file into a pdf file, while the chm file has much more pages. How can I convert the whole chm file into a pdf file? Thanks. [1]: https://www.dropbox...
I want to convert a chm file to a pdf file.
Calibre's command ebook-convert
ebook-convert 1.chm 1.pdf
only converts the first 7 pages of the chm file into a pdf file, while the chm file has much more pages. How can I convert the whole chm file into a pdf file? Thanks.
Tim
(106420 rep)
Dec 1, 2015, 04:17 AM
2
votes
1
answers
399
views
How to change programs used to handle files in Calibre in Debian
I have recently installed Calibre, and it works great, however I have some problems with handling of files by this program: * Folders open in ``baobab``. To open folder I just need to click on a book and then select: ``Path: Click to open``. * CBR files open in print-preview. Gobal file associations...
I have recently installed Calibre, and it works great, however I have some problems with handling of files by this program:
* Folders open in `
baobab
. To open folder I just need to click on a book and then select:
Path: Click to open
`.
* CBR files open in print-preview.
Gobal file associations are sensible (I have checked `~HOME/.config/mimeapps.list
`) and cbr files open properly in nautilus.
So questions are:
* How does Calibre detect file associations.
* How to change those associations.
I use i3 window manager.
jb.
(739 rep)
Aug 24, 2015, 11:17 AM
• Last activity: Aug 28, 2015, 07:17 AM
1
votes
2
answers
1195
views
Calibre don't convert from epub to mobi
Calibre did not convert my Epub Books to Mobi. It aborts with this Error: TypeError: QPixmap(): argument 1 has unexpected type 'ImageView' This is the full Error Message: calibre 2.20 isfrozen: False is64bit: True Linux-3.18.6-1-ARCH-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF') ('Linux', '3.18.6-1-...
Calibre did not convert my Epub Books to Mobi. It aborts with this Error:
TypeError: QPixmap(): argument 1 has unexpected type 'ImageView'
This is the full Error Message:
calibre 2.20 isfrozen: False is64bit: True
Linux-3.18.6-1-ARCH-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF')
('Linux', '3.18.6-1-ARCH', '#1 SMP PREEMPT Sat Feb 7 08:44:05 CET 2015')
Python 2.7.9
Linux: ('', '', '')
Traceback (most recent call last):
File "/usr/lib/calibre/calibre/gui2/device.py", line 1257, in dispatch_sync_event
self.sync_to_device(on_card, delete, fmt)
File "/usr/lib/calibre/calibre/gui2/device.py", line 1531, in sync_to_device
self.iactions['Convert Books'].auto_convert(auto, on_card, format)
File "/usr/lib/calibre/calibre/gui2/actions/convert.py", line 76, in auto_convert
jobs, changed, bad = convert_single_ebook(self.gui, self.gui.library_view.model().db, book_ids, True, format)
File "/usr/lib/calibre/calibre/gui2/tools.py", line 41, in convert_single_ebook
d = SingleConfig(parent, db, book_id, None, out_format)
File "/usr/lib/calibre/calibre/gui2/convert/single.py", line 151, in __init__
self.setup_pipeline()
File "/usr/lib/calibre/calibre/gui2/convert/single.py", line 201, in setup_pipeline
self.mw = widget_factory(MetadataWidget)
File "/usr/lib/calibre/calibre/gui2/convert/single.py", line 199, in widget_factory
self.plumber.get_option_help, self.db, self.book_id)
File "/usr/lib/calibre/calibre/gui2/convert/metadata.py", line 55, in __init__
Widget.__init__(self, parent, ['prefer_metadata_cover'])
File "/usr/lib/calibre/calibre/gui2/convert/__init__.py", line 62, in __init__
self.setupUi(self)
File "/usr/lib/calibre/calibre/gui2/convert/metadata_ui.py", line 51, in setupUi
self.cover = ImageView(self.groupBox_4)
File "/usr/lib/calibre/calibre/gui2/widgets.py", line 298, in __init__
self._pixmap = QPixmap(self)
TypeError: QPixmap(): argument 1 has unexpected type 'ImageView'
I'm using Archlinux and Calibre Version 2.20
Kevin
(133 rep)
Mar 2, 2015, 04:50 PM
• Last activity: Mar 5, 2015, 02:41 AM
0
votes
1
answers
589
views
Calibre (E book management) problem on Elementary OS Luna
I have had Calibre installed for some time now and it has always worked fine. Right now I tried to send a book from the Calibre library to my Kindle and I keep getting this message: calibre, version 0.8.38 ERROR: Error: Error communicating with device The reader has no storage card in this slot. Tra...
I have had Calibre installed for some time now and it has always worked fine. Right now I tried to send a book from the Calibre library to my Kindle and I keep getting this message:
calibre, version 0.8.38
ERROR: Error: Error communicating with device
The reader has no storage card in this slot.
Traceback (most recent call last):
File "/usr/lib/calibre/calibre/gui2/device.py", line 81, in run
self.result = self.func(*self.args, **self.kwargs)
File "/usr/lib/calibre/calibre/gui2/device.py", line 411, in _upload_books
metadata=metadata, end_session=False)
File "/usr/lib/calibre/calibre/devices/usbms/driver.py", line 252, in upload_books
path = self._sanity_check(on_card, files)
File "/usr/lib/calibre/calibre/devices/usbms/device.py", line 978, in _sanity_check
raise ValueError(_('The reader has no storage card in this slot.'))
ValueError: The reader has no storage card in this slot.
The book can't be sent to the device. I tried to remove Calibre and re-install it but it did not work.
**Edit 1)**
Immediately after plugging in the kindle and running lsusb i get:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 004: ID 04f2:b307 Chicony Electronics Co., Ltd
Bus 001 Device 007: ID 1949:0004 Lab126 Amazon Kindle 3
and after running dmesg | tail i get:
[ 7202.714177] usb 1-1.2: new high-speed USB device number 7 using ehci_hcd
[ 7202.829763] scsi8 : usb-storage 1-1.2:1.0
[ 7203.831695] scsi 8:0:0:0: Direct-Access Kindle Internal Storage 0100 PQ: 0 ANSI: 2
[ 7203.832255] sd 8:0:0:0: Attached scsi generic sg2 type 0
[ 7203.837580] sd 8:0:0:0: [sdb] 2846720 512-byte logical blocks: (1.45 GB/1.35 GiB)
[ 7203.942275] sd 8:0:0:0: [sdb] Write Protect is off
[ 7203.942287] sd 8:0:0:0: [sdb] Mode Sense: 0f 00 00 00
[ 7204.052235] sd 8:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 7204.323058] sdb: sdb1
[ 7204.551835] sd 8:0:0:0: [sdb] Attached SCSI removable disk
aksonai
(3 rep)
Dec 16, 2014, 10:08 PM
• Last activity: Dec 18, 2014, 10:12 AM
2
votes
1
answers
134
views
Calibre in Debian 7.3 KDE doesn't have cover browser?
Can someone please help me to activate the **cover browser** of Calibre in Debian 7.3 KDE desktop (32 bit architecture)? I've tried toggling the arrow button in the bottom-right corner but unlike the other buttons, it yields nothing, not even a tool-tip when I hover over it. I've tried also clicking...
Can someone please help me to activate the **cover browser** of Calibre in Debian 7.3 KDE desktop (32 bit architecture)? I've tried toggling the arrow button in the bottom-right corner but unlike the other buttons, it yields nothing, not even a tool-tip when I hover over it. I've tried also clicking
**NOTE:** I'm using version 0.8.51.
Preferences > Look&feel > Cover Browser tab
but there's nothing usable there. Please see the pictures below.


WobblyWindows
(777 rep)
Jan 14, 2014, 05:39 PM
• Last activity: Jan 14, 2014, 07:21 PM
4
votes
2
answers
1606
views
How to prevent a Qt/GTK app (Calibre) from using colors defined in .Xresources?
I have colors defined in .Xresources. They look lovely on urxvt, and utterly ghastly on Calibre. Calibre does not appear to have any way to disable or override those colors, so is there any way I can invoke Calibre that would ignore my color scheme?
I have colors defined in .Xresources. They look lovely on urxvt, and utterly ghastly on Calibre.
Calibre does not appear to have any way to disable or override those colors, so is there any way I can invoke Calibre that would ignore my color scheme?
Trevor Bramble
(143 rep)
Oct 9, 2012, 06:31 AM
• Last activity: Sep 1, 2013, 07:47 PM
Showing page 1 of 20 total questions