1

Looking to convert an epub to mobi with calibre:

nicholas@gondor:~/ebooks$ 
nicholas@gondor:~/ebooks$ flatpak --command="sh" run com.calibre_ebook.calibre -c "ebook-convert ~/in.epub ~/out.mobi"
Cannot read from /home/nicholas/in.epub
nicholas@gondor:~/ebooks$ 
nicholas@gondor:~/ebooks$ ll
total 1200
drwxrwxr-x  2 nicholas nicholas    4096 Jul 18 13:43 ./
drwxr-xr-x 28 nicholas nicholas    4096 Jul 18 13:16 ../
-rw-r--r--  1 nicholas nicholas 1220236 Jul 18 13:16 in.epub
nicholas@gondor:~/ebooks$ 
nicholas@gondor:~/ebooks$ uname -a
Linux gondor 5.8.0-59-generic #66-Ubuntu SMP Thu Jun 17 00:46:01 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
nicholas@gondor:~/ebooks$ 
nicholas@gondor:~/ebooks$ flatpak info com.calibre_ebook.calibre

calibre - The one stop solution to all your e-book needs

      ID: com.calibre_ebook.calibre
     Ref: app/com.calibre_ebook.calibre/x86_64/stable
    Arch: x86_64
  Branch: stable
 Version: 5.23.0
 License: GPL-3.0
  Origin: flathub

Collection: org.flathub.Stable Installation: system Installed: 360.9 MB Runtime: org.freedesktop.Platform/x86_64/20.08 Sdk: org.freedesktop.Sdk/x86_64/20.08

  Commit: 13464e660f35716a725261af4b45d3abc199a3ce52ebdd9ee887c7ae623b5873
  Parent: 4f7f3b603f31cc781caf8260f887118a1bb466748891c9e122826728e25d3eed
 Subject: Update calibre-5.22.1-x86_64.txz to 5.23.0 (9184a3f3)
    Date: 2021-07-11 19:56:21 +0000

nicholas@gondor:~/ebooks$

The file was readable and converted to mobi fine with an online converter. The converted file loaded on a Kindle fine, so there's presumably no problem with the epub itself. The book is readable on the Kindle, converted fine.

How is this accomplished from the console using the flatpak install of calibre?


note: the GUI for calibre reads from the home directory fine and adds books to its library. This book is, in fact, in the calibre library. The scope of the question is just how to use the conversion script for the flatpak install of calibre.

There's nothing odd or unique about permissions to directories, it's a vanilla install. Presumably some flatpak weirdness.

1 Answers1

1

You are using wrong paths in command line.
The ~/in.epub and ~/ebooks/in.epub are different paths.

So you have to use correct paths:

flatpak --command="sh" run com.calibre_ebook.calibre -c "ebook-convert ~/ebooks/in.epub ~/ebooks/out.mobi"

or

cd ~/ebooks
flatpak --command="sh" run com.calibre_ebook.calibre -c "ebook-convert in.epub out.mobi"
N0rbert
  • 103,263