Ubuntu – Suddenly Okular will not open any more

18.04okularpdfqt5shared library

I have made my laptop double boot a few months again, with Ubuntu 18.04.1 . I have been working with okular to open pdf files (for the commenting option) but suddenly okular doesn't work anymore. When trying to open okular I get the following error:

Unable to find the Okular component: Cannot load library /snap/okular/39/usr/lib/x86_64-linux-gnu/qt5/plugins/okularpart.so: (libKF5JSApi.so.5: cannot open shared object file: No such file or directory)

I don't understand how to solve this problem. Okular was working fine until today and I didn't change anything to my ubuntu system in the mean time. Perhaps the problem comes from the fact that I have been working on windows the last few days and also used the windows ubuntu app.

How can I make okular work again?

Best Answer

  • I understand that you've installed Okular from snap. It seems that the file okularpart.so either got corrupted or its permissions changed. You can try the following things to fix Okular until one succeeds:

    1. Try to refresh the snaps: sudo snap refresh

    2. Try to remove and reinstall Okular: sudo snap remove okular && sudo snap install okular

    3. Remove Okular snap and give a try to apt install: sudo snap remove okular && sudo apt install okular (there are quite a lot of dependencies if you use a GTK based environment such as Gnome)