2

I have recently upgraded from Kubuntu 16 to 18. When I try to run okular in a terminal (konsole) as a user (as I have been successfully doing before, in vs 16), in vs 18 it fails, giving a message error: "Unable to find the okular component: The shared library was not found". I can run okular from the Application Menu, and also from terminal provided I run it with sudo, but not when I try as a user. I wonder what has changed in the upgrading and how to fix the problem. Thanks.

Raffa
  • 32,237
  • Welcome to Ask Ubuntu. By Kubuntu 18 I gather you mean 18.04 LTS (ie. 2018.April release). Normally an error message tells you the shared library it was looking for that it couldn't find, so please re-run it and copy & whole message(s) & paste into your question so we can see what actually is missing, to help you rectify your issue. There are a number of libraries used by okular (https://packages.ubuntu.com/bionic/okular) – guiverc Aug 29 '18 at 11:44
  • 2
    @guiverc The puzzling thing is that okular runs from the "Application Menu" but apparently not from the terminal unless the user uses sudo!!! And okular works for me whether I access it from the terminal or from the Application Menu or by double-clicking on a pdf file in Dolphin (the file manager). The mysteries of upgrading? – DK Bose Aug 29 '18 at 12:01
  • 1
    You may also have a snap of okular installed, and it's being run from the menu, but not from terminal (due to order of listed directories maybe - use snap list to view what snaps you have installed). With snaps you can multiple versions of programs installed. – guiverc Aug 29 '18 at 12:08
  • Possible duplicate: https://askubuntu.com/questions/133274/can-not-run-okular-due-to-unable-to-find-okular-component-error since it works with sudo. – DK Bose Aug 29 '18 at 12:19
  • If you get any output from running find . -user root -ls I suggest you refer to the link I posted above. – DK Bose Aug 29 '18 at 13:26
  • 1
    Yes, by Kubuntu 18 I mean 18.04 LTS (just for short). I have tried with okularand /usr/bin/okular. In both cases, the only message that I got is that appearing in a pop-up window as quoted in my query. No message appeared in the terminal. It is unlikely that some library is lacking as I can run okular in terminal as root. I have run snap list as suggested by @guiverc obtaining "No snaps are installed yet". I have followed the instructions in the link provided by @DKBose so that running in my user find . -user root -ls now gives no output. The problem remains the same. – Rafael Lopez Aug 30 '18 at 20:36
  • Double clicking on a pdf file in Dolphin also works. – Rafael Lopez Aug 30 '18 at 20:46
  • When I run okular file.pdf (i.e. passing the name of an existing pdf file as argument), apart from the message in the pop-up window, I get this message in the terminal: "org.kde.kwindowsystem: Could not find any platform plugin" – Rafael Lopez Aug 30 '18 at 21:06
  • If you get no issues when run as root, then you may have changed a setting whilst using 'root' & have thus forced change-of-permissions meaning you have issues when no longer running as root (my thinking is instead of writing the config/other change, it read & re-wrote the file making owner=root as side effect of you using root at the time) I don't have the program (or KDE) loaded on this box so I don't know where to look, but I'd look for a config file owned by root possibly in ~/.local or ~/.config (or subdirectories in each - look for okular files; chown to yourself if owned by root) – guiverc Aug 30 '18 at 22:59
  • Same problem in Ubuntu 18.04. Take note that the program does not crash; if I do pgrep okular I get a pid. And, as mentioned elsewhere, I can launch the program regularly from the application menu: the problem only occurs in the shell. – XavierStuvw Dec 15 '19 at 08:38

2 Answers2

0

Perhaps this is not the solution you are asking for, but I fixed this on my machine by removing the snap version of Okular and installing the apt version instead.

mikeglaz
  • 163
-1

I found the answer to the mystery. It was in my .bashrc file which contained a line: export LD_LIBRARY_PATH=/usr/local/Qt/5.10.1/gcc_64/lib:$LD_LIBRARY_PATH which caused this and other similarly odd problems with other applications (kilefor instance). This appeared after upgrading, as that line was harmless before. I must finally mention that the quoted library directory exists in my installation (i.e. the problem is not caused because the directory is lacking).

  • 1
    How did you then fix the issue? For example, on removing that line or giving another location? I gather that that path element had a purpose to provide Qt 5.10.1 to some other applications – XavierStuvw Dec 15 '19 at 08:35