Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Today I found online saying that Okular is a very good document viewer. So I installed it from the software center. After the installation, Okular could not open any PDF files. Actually it could not open file. It always complained that "Cannot find a plug in..." and "Could not open ... pdf file".

I looked up on this site, and found somebody said we should delete the related configuration files under ~/.kde/share/. But I didn't found those files there.

BTW, I'm using the Unity desktop.

share|improve this question
    
to get more info open the document from the terminal with okular like this okular mypdf.pdf and add the output to you question alternatively you can add nohup to the begining of the command and any messages will be added to nohup.out making it easy to copy them, the command would look like this nohup okular /home/user/mypdf.pdf –  Allan Oct 5 '11 at 8:52
    
@Jorge Castro: Thank you very much for your reply. From the output, it seems that I don't have the permission to create folder in /home/username/.kde/. So I added sudo to run the command, and it worked. How can I open the pdf file directly with clicking the pdf? Thank you. The output is as follows: –  Guangchun Oct 5 '11 at 15:17
    
(Continued) trying to create local folder /home/cheng/.kde/cache-guangchun: Permission denied okular(8956)/kdeui (KIconLoader) KSharedDataCache::Private::mapSharedMemory: Failed to establish shared memory mapping, will fallback to private memory -- memory usage will increase trying to create local folder /home/cheng/.kde/cache-guangchun: Permission denied trying to create local folder /home/cheng/.kde/cache-guangchun: Permission denied trying to create local folder /home/cheng/.kde/cache-guangchun: Permission denied –  Guangchun Oct 5 '11 at 15:20
    
I change the mode using chmod of the directory /home/cheng/.kde/chache and /home/cheng/.kde/cache-guangchun to 777, and it works now. I don't know if there are other better ways to do this. –  Guangchun Oct 5 '11 at 15:53
    
@user26215 Welcome to askubuntu. The way this site works is to edit your original question and add the information there, that way we have it up front instead of buried in the comments. Just click edit and paste what you've been putting in the comments there. Thanks! –  Jorge Castro Oct 5 '11 at 17:05

3 Answers 3

The OP posted the solution in a comment

I change the mode using chmod of the directory /home/cheng/.kde/chache and /home/cheng/.kde/cache-guangchun to 777, and it works now.

share|improve this answer

I ran into this misleading error as well. In my case the console log indicated:

okular(30121)/kdecore (trader): KMimeTypeTrader: couldn't find service type "okular/Generator" 
Please ensure that the .desktop file for it is installed; then run kbuildsycoca4. 
okular(30121)/okular (app) Okular::Document::openDocument: No plugin for mimetype '"application/pdf"'.

As instructed I ran kbuildsycoca4:

~% kbuildsycoca4
kbuildsycoca4 running...
kbuildsycoca4(30132) kdemain: Reusing existing ksycoca
kbuildsycoca4(30132) KBuildSycoca::recreate: Recreating ksycoca file ("/var/tmp/kdecache-tmetro/ksycoca4", version 205)
kbuildsycoca4(30132) KBuildSycoca::createEntry: new: "okularGenerator.desktop" in servicetypes
kbuildsycoca4(30132) KBuildSycoca::createEntry: new: "libokularGenerator_xps.desktop" in services
kbuildsycoca4(30132) KBuildSycoca::createEntry: new: "okularEPub.desktop" in services
kbuildsycoca4(30132) KBuildSycoca::createEntry: new: "okularPlucker.desktop" in services
kbuildsycoca4(30132) KBuildSycoca::createEntry: new: "libokularGenerator_fax.desktop" in services
[...etc for several screen...]

After that okular was able to load PDFs.

Seems like a packaging bug. That should have ran from a post-install script.

share|improve this answer

I faced the same problem so I tried the command:

$kbuildsycoca4

but it felt to run, because I needed to install some kde libs. Then I installed such libs typing:

sudo apt-get install kdelibs-bin

After that Okular was able to open PDF's.

Is this a bug? I'm running Linux Mint 17.1 in a fresh installation.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.