Score:1

How to run or execute the ebook-convert script from a flatpak install of calibre?

mx flag

Where and how can I run the ebook-convert script for calibre from the console?

nicholas@gondor:~$ 
nicholas@gondor:~$ 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:~$ 
nicholas@gondor:~$ 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:~$ 
nicholas@gondor:~$ man calibre
No manual entry for calibre
nicholas@gondor:~$ 
nicholas@gondor:~$ ebook-convert
Command 'ebook-convert' not found, but can be installed with:
sudo apt install calibre
nicholas@gondor:~$ 

Installed via flatpak because:

1.) calibre is, or at least wasn't, in snap repo 2.) have had problems with the apt version in the past

more of a flatpak usage q than specific to Ubuntu. Probably a calibre or flatpak man page will explain where or how to launch the conversion script -- but which man page?

tried:

nicholas@gondor:~$ 
nicholas@gondor:~$ flatpak run com.calibre_ebook.calibre.ebook-convert
error: app/com.calibre_ebook.calibre.ebook-convert/x86_64/master not installed
nicholas@gondor:~$ 
nicholas@gondor:~$ flatpak run com.calibre_ebook.ebook-convert
error: app/com.calibre_ebook.ebook-convert/x86_64/master not installed
nicholas@gondor:~$ 

see also

how to launch flatpak calibre from the console?

Score:3
zw flag

According to Debugging section of Flatpak guide and man flatpak-run you can use special --command argument.

So we need to enter the shell by

flatpak --command="sh" run com.calibre_ebook.calibre

and then run conversion here:

[ com.calibre_ebook.calibre ~]$ ebook-convert in.epub out.fb2
1% Converting input to HTML...
InputFormatPlugin: EPUB Input running
on /home/user/in.epub
...
Converting XHTML to FB2 markup...
FB2 output written to /home/user/out.fb2
Output saved to   /home/user/out.fb2
[ com.calibre_ebook.calibre ~]$ exit
$ ls in.epub out.fb2
in.epub  out.fb2

Or more straight-forward:

flatpak --command="sh" run com.calibre_ebook.calibre \
-c "ebook-convert ~/in.epub ~/out.fb2"
Score:1
cn flag

I don't know how flatpak works, but I was able to find the script like this:

$ which calibre
/usr/bin/calibre
$ ls -artl /usr/bin/calibre
lrwxrwxrwx 1 root root 20 Jul  2 20:18 /usr/bin/calibre -> /opt/calibre/calibre
$ cd /opt/calibre
ls -artl ebook-convert
-rwxr-xr-x 1 root root 6400 Jun 25 14:54 ebook-convert
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.