Ubuntu – Mimetype mess after calibre installation. How to fix it

calibrefile formatmime-typenautilus

I always get text/plain or application/octet-stream when running "mimetype" on all file types.

The command "file –mime-type" seems to identify correctly the different file types. For instance, if I run it on a PDF file, I get

filename.pdf: application/pdf

But if I try to run "mimetype" on the same PDF file, I get

filename.pdf: text/plain

Similarly, if I run "file –mime-type" on a mp3 file, I get

filename.mp3: audio/mpeg

But if I try to run "mimetype" on the same mp3 file, I get

filename.mp3: application/octet-stream

As a consequence, I cannot open some files with the suitable application. For example. I cannot open a PDF file with evince. And I cannot set the "Open with" option of Nautilus to open each file-format with the suitable application.

I have tried to run sudo update-mime-database /usr/share/mime but it does not fix the problem.

I have noticed that, if I run "mimetype" as the first user, I get this message

WARNING: You don't seem to have a mime-info database. The shared-mime-info package is available from http://freedesktop.org/

However the shared-mime-info package seems to be correctly installed.

Best Answer

The problem was solved reinstalling the shared-mime-info package, as suggested by Glutanimate, with

sudo apt-get install --reinstall shared-mime-info

Related Question