2

Whenever I try opening a PDF file in a mounted usb drive using Okular, it gives me this error: Could not open file:///media/walkeknow/F8A2-34D9/example.pdf

Okular error dialog

I have installed okular using sudo snap install okular because the apt-get method does not render the in-app icons for some reason on my system.

which okular command gives: /snap/bin/okular

The files open using Ubuntu's default Document Viewer evince. However I prefer using Okular. Is there any fix to this?

Kewal Shah
  • 1,034
  • 2
  • 13
  • 35
  • How did you installed Okular? Please add output of `which okular` to the question. – N0rbert Apr 24 '19 at 19:33
  • 1
    Possible duplicate of [How to get access to USB-storage from the application installed as Snap?](https://askubuntu.com/questions/1034030/how-to-get-access-to-usb-storage-from-the-application-installed-as-snap) – N0rbert Apr 24 '19 at 19:41
  • @N0rbert I tried the answer in the link you marked this question is a duplicate of, but `snap connect okular:removable-media` gave `error: snap "okular" has no plug named "removable-media"` – Kewal Shah Apr 24 '19 at 19:44
  • I see, so see my answer below. – N0rbert Apr 24 '19 at 19:45

2 Answers2

2

Snap problem

Okular does not support removable media while installed as Snap. You should remove it

snap remove okular

In other words it does not support snap connect okular:removable-media plug.

Okular from APT (deb-package)

Installation

Then install deb-packaged version instead with

sudo apt-get install okular

Set-up look and feel

To get normal look and feel you need to install Breeze KDE theme with

sudo apt-get install breeze qt5ct

and select it from qt5ct with

QT_QPA_PLATFORMTHEME=qt5ct qt5ct

then switch to Icon Theme tab and select Breeze here and hit Save:

qt5ct

To make changes permanent add this line to your ~/.profile with

echo "export QT_QPA_PLATFORMTHEME=qt5ct" >> ~/.profile 

then reboot and use Okular with files from anywhere:

Okular on Ubuntu 18.04 LTS with GNOME

Note: I tested the method above on Ubuntu 18.04 LTS with GNOME Shell and MATE.

N0rbert
  • 97,162
  • 34
  • 239
  • 423
1
  1. Goto ubuntu's software manager.
  2. Goto Installed.
  3. Locate Okular and press it.
  4. Change the permissions to "read/write files on removable device".