2

I removed Adobe from my Ubuntu 22.04.3 LTS and, since then, xdg-open file.pdf opens the file with libreoffice rather than Document viewer. Purging libreoffice completely solves the problem, however it persists if I re-install it. I could live like this, where I remove and re-install libreoffice, since I don't use it much in the first place, however I believe that there should be a fix for this. Is there a way to tell xdg-open Please, open pdfs with this other app? I did do some googling but I couldn't find anything clear-cut that I could understand.

Edit: there's not tick to do when opening a pdf file, so I have no way to chose a default app from there

no tick

Thank you very much

Edit2: the suggested similar question here is somehow not applicable for me, I see none of the options listed for the GUI solution in my system and I don't fully understand the non-GUI solution. On the other hand, the suggested (comments) xdg-mime default org.gnome.Evince.desktop application/pdf command works wonderfully!

SO_32
  • 163

1 Answers1

3

Sometimes the file association GUI may be confusing, unreliable, and different across Ubuntu releases, so the command line is a reliable way of setting it:

xdg-mime default org.gnome.Evince.desktop application/pdf

I looked in /usr/share/applications for the right *.desktop file name. In this case, you specifically want the Document Viewer app and it is internally named org.gnome.Evince.desktop. xdg-mime default is just the command to change file associations. application/pdf is the MIME type for PDF files.

Daniel T
  • 4,594