Ubuntu – Can’t change PDF default

default-programsevincemime-typepdf

Up until yesterday my default PDF viewer was evince. Today, I tried to open a PDF and it opened with ImageMagick. I am trying to change it back to evince but with no success. What I 've tried:

  • Changing it the standard GUI way from the file manager.
  • Editing ~/.local/share/applications/mimeapps.list
  • Deleting ~/.local/share/applications/mimeapps.list
  • $ xdg-mime default evince.desktop application/pdf
  • Tried with the Trusty version of Ubuntu Tweak (I am on 15.04)

I also checked the /usr/share/applications/mimeinfo.cache and /etc/gnome/defaults.list and both have evince.desktop as the first option.

As an extra note, changing other defaults works.

Best Answer

I have searched for all locations containing mime type associations and finally found the solution:

$ nano ~/.config/mimeapps.list

application/pdf was correctly set but image/pdf was set to ImageMagick. Edit it to your own preferences (evince.desktop in my case).

Checking if the PDF file is of application or image type was one of the first things I did (and it was application/pdf), so I suspect this is a bug.