74

How do I convert epub to mobi using Calibre for this?

Damjan Pavlica
  • 388
  • 3
  • 10
Nickolai Leschov
  • 8,120
  • 19
  • 49
  • 90

6 Answers6

129

Yes, Calibre package contains a script called ebook-convert to convert ebooks between formats. You can install Calibre with

sudo apt-get install calibre

then

ebook-convert "book.epub" "book.mobi"

NB: Other formats are supported, too:

ebook-convert "book.azw3" "book.pdf"
muru
  • 193,181
  • 53
  • 473
  • 722
Nickolai Leschov
  • 8,120
  • 19
  • 49
  • 90
  • FWIW, the quotes aren't strictly necessary. – kjprice Feb 03 '16 at 03:29
  • 2
    To get an epub->pdf conversion to run, I had to make have `xvfb` installed and then run the `ebook-convert` command using: `xvfb-run ebook-convert book.epub book.pdf` – Raymond Yee Mar 02 '16 at 23:33
  • I've figured out another way to use `ebook-convert` on a headless/server machine, without having to install Qt/X11 dependencies: https://askubuntu.com/a/1453851/182054 – Mladen B. Feb 07 '23 at 05:24
18

I found a script for batch conversion:

for book in *.epub; do echo "Converting $book"; ebook-convert "$book" "$(basename "$book" .epub).mobi"; done

It works good for me, but the process is pretty slow.

Damjan Pavlica
  • 388
  • 3
  • 10
4

Install calibre. Works with any arbitrary folder depth.

find . -name '*.epub' -type f -exec bash -c 'ebook-convert "$0" "${0%.epub}.mobi" --prefer-author-sort --output-profile=kindle --linearize-tables --smarten-punctuation --enable-heuristics' {} \;
bhaalduct
  • 41
  • 1
2

You can also do this without installing Calibre. This would be really handy on a Chromebook, for example. There is a free, online site called EPUB Converter that will let you upload the epub and it lets you then download the mobi equivalent.

redbmk
  • 213
  • 1
  • 2
  • 8
1

As of November 2021. I had to run the command using sudo.

E.g

sudo ebook-convert book.epub book.mobi

I didn't need the quotes, but you can use them if your file name has spaces. E.g:

sudo ebook-convert "book one.epub" "book one.mobi"

Everything else works as described in the accepted answer above.

Ai Xing
  • 11
  • 1
1

Yes, you can use Calibre for epub to mobi conversion. They declare mobi as supported output format in their FAQ.

I don’t think there’s anything Ubuntu-specific in the question, so it would probably belong somewhere else.

  • 1
    I think this question is relevant because I wasn't aware that Calibre was available for Ubuntu. For some reason I thought it was like Scrivener and Windows/Mac only. – m0j0 Feb 04 '15 at 02:54