In last post I was discussing how to connect Kindle Fire HD to Ubuntu. Once I had fixed the connection problem, I tried to transfer a comic book in .cbr format to Kindle. Unfortunately, Kindle does not read .cbr file. So the last option I was left with was to convert .cbr file to Kindle readable format such as MOBI.
I used Calibre, an amazing free and open source ebook management software to convert .cbr files to MOBI format. While conversion, Calibre gave an error:
ERROR: Conversion Error: <b>Failed</b>: Convert book 1 of 1 (A Game Of Thrones 01)
OSError: libunrar.so: cannot open shared object file: No such file or directory
Is there no libunrar.so in this world?
It was surprising for me because I had installed unrar last night only. I tried to install it again. It gave the same error. I also tried with my favorite solution to fix “cannot open shared object file” in Ubuntu. but even that did not fix the problem.
For some reason Calibre explicitly needed libunrar.so library. I could not find libunrar.so anywhere individually. Some forum suggested to manually download the executable of Calibre and get the library from there. But guess what? My stars were not in my favor. Even the latest version of Calibre (0.9.9) did not have this library.
What the heck, I thought. Lets check the older version of Calibre. Phew! It was there.
Solve OSError: libunrar.so: cannot open shared object file
So lets see how can you install libunrar.so.
- First grab Calibre version 0.7.23. I have checked that it contains libunrar.so. Download the file based on whether you are using 32 bit or 64 bit Ubuntu.
- Once it is downloaded, extract it. You can extract it by right clicking and then choosing Extract Here.
- Go to the directory where it is extracted. You can find the libunrar.so file there.
- Open a terminal and go to the directory where Calibre was extracted.
- Assuming that you are in calibre-0.7.23-XX directory, use the following commands:
sudo cp libunrar.so /usr/local/lib/
- Since you have manually copied the lib file, you need to tell the linker about the presence of this file. Use the following command:
sudo /sbin/ldconfig -v
And that is it. Now you can continue using Calibre to convert .cbr or rar files to Kindle ready MOBI format. Enjoy