4

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.

1
  • 1
    Have you tried reinstalling shared-mime-info? You can do so with sudo apt-get install --reinstall shared-mime-info. Jun 22, 2014 at 12:44

2 Answers 2

3

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

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

0

You can also manually fix this by editing the file:

/usr/share/applications/mimeinfo.cache

Remove all references to calibre-ebook-edit.desktop;, calibre-ebook-viewer.desktop;, and calibre-gui.desktop;.

The change will be instant, so you can test if the removed references resolved the default association.

This is not Ubuntu specific, should work on all distributions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .