12

As it was instructed in another thread here in the forums, I opened the /usr/share/applications/mimeinfo.cache file to check for correct references. And noticed this doesn't seem to be the problem, there even are 3 optional browsers to use.

x-scheme-handler/http=google-chrome.desktop;chromium-browser.desktop;firefox.desktop;
x-scheme-handler/https=google-chrome.desktop;chromium-browser.desktop;firefox.desktop;

I already checked that the programs are correctly named, using the "which" command in the terminal, like this:

$ which google-chrome
$ /usr/bin/google-chrome

So google-chrome should be the first option and yet the order to open a url doesn't seem to be arriving to the program, not even to the 2nd or 3rd option for that matter anyways.

Also, the 'Get help online...' command in the 'Help' menu doesn't work. So it is not a problem with the specific document file either.

I'm running Ubuntu 12.04 LTS. If you need to ask for more relevant details, please do. It would be nice to have various opinions on how to solve this, thank you :-)

UPDATE: I ran evince from the terminal as asked.
This is what I'm getting when trying to open a link:

/opt/google/chrome/google-chrome: line 42: /opt/google/chrome/chrome: Permission denied
/opt/google/chrome/google-chrome: line 42: /opt/google/chrome/chrome: Success

Should I try the fix you suggested even if my error log is different?

UPDATE: Tried @maggotbrain's solution and BINGO, now I can study pdf references faster thanks to you bro!

JorgeArtware
  • 3,527
  • 1
  • 21
  • 23
  • Could you run evince from a terminal and try clicking on a URL within the pdf again. Then add any error messages to your original question? Thanks. – Kevin Bowen Jul 09 '13 at 05:25
  • related Q & A where the suggested answer does not work for OP: http://askubuntu.com/questions/254212/why-dont-hyperlinks-open-in-evince-document-viewer?rq=1 – Kevin Bowen Jul 09 '13 at 05:38
  • 1
    I just updated on new findings. I'm sorry I can't upvote answers just yet, I'm new in the community. – JorgeArtware Jul 09 '13 at 07:38
  • No worries. Welcome! You can try my solution and see if it works for you even though the error messages are different. If it doesn't work, just remove lines from file and re-run command. Best of luck. – Kevin Bowen Jul 09 '13 at 07:41

5 Answers5

5

None of the above solutions worked for me, however this does work :

See what is currently on its ignore list

ls -la /etc/apparmor.d/disable

Now add Document Viewer (evince) to that list

sudo ln -s /etc/apparmor.d/usr.bin.evince /etc/apparmor.d/disable/usr.bin.evince 

engage the change

sudo service apparmor restart
  • Worked for me, I've been searching for a while! Any details about what this does exactly? – Jonathan H Jan 18 '16 at 16:43
  • works like a charm – Jingguo Yao Sep 30 '16 at 02:09
  • 2
    @Sh3ljohn This basically appears to disable all security hardening applied to evince. Remember that PDFs are basically bunches of complex data to be parsed and displayed (and somehow executed, too) through a complex software stack. So they are known vectors for attack. – Stéphane Gourichon Oct 23 '16 at 18:10
  • 3
    @StéphaneGourichon Is that a dangerous thing to do then? I don't want all security checks to be disabled, I would just like to be able to click links. – Jonathan H Oct 23 '16 at 18:38
3

You may be running up against a bug with apparmor's handling of external URLs.

The problem that I was having opening URLs within evince resulted in the following error being generated (on the command line) whenever clicking on a URL within a pdf document:

(evince:32091): EvinceView-CRITICAL **: ev_document_model_set_document: assertion
`EV_IS_DOCUMENT (document)' failed
/usr/lib/chromium-browser/chromium-browser-sandbox: error while loading shared
libraries: libpthread.so.0: failed to map segment from shared object: Permission denied

As suggested in this comment, I was able to fix this issue with chromium by doing the following:

Add these lines to /etc/apparmor.d/abstractions/ubuntu-helpers after the line "/usr/lib*/{,*/} Pixr,":

# From https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/964510/comments/12
# While the chromium and chrome sandboxes are setuid root, they only link
# in limited libraries so glibc's secure execution should be enough to not
# require the santized_helper (ie, LD_PRELOAD will only use standard system
# paths (man ld.so)).
/usr/lib/chromium-browser/chromium-browser-sandbox PUxr,
/opt/google/chrome/chrome-sandbox PUxr,
/opt/google/chrome/google-chrome Pixr,
/opt/google/chrome/chrome Pixr,
/opt/google/chrome/lib*.so{,.*} m,

Finally, run sudo apparmor_parser -T -W -r /etc/apparmor.d/usr.bin.evince

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
  • I googled the log and the search results threw the same page you gave me, about bug #964510 (on bugs.launchpad.net), so thats a go-go for me. I will try that. Will keep you informed about outcomes. :) – JorgeArtware Jul 09 '13 at 07:46
  • 1
    you are the man! It not only worked but I learned on how to diagnose things by myself :D Thank you!! – JorgeArtware Jul 09 '13 at 07:57
  • Excellent! Your asking the question helped me solve a problem that I had but forgot about until now. Thanks to you. Cheers. – Kevin Bowen Jul 09 '13 at 08:07
  • This worked -- once I made certain to follow the instructions more carefully than my first attempt afforded. That is: make sure you insert the suggested lines 'after the line "/usr/lib/{,/} Pixr,":'. – MarkWayne Jul 10 '14 at 15:58
  • 1
    This did not work for me on Ubuntu 16. There is no line with the exact content /usr/lib*/{,*/} Pixr,. – Cerin Dec 12 '16 at 18:28
2

I have Chromium (not Chrome) on Ubuntu 14.04 and adding

/usr/lib/chromium-browser/chrome-sandbox PUxr after the string

/usr/lib/chromium-browser/chromium-browser-sandbox PUxr

in the file /etc/apparmor.d/abstractions/ubuntu-helpers, then sudo service apparmor reload solved this problem for me.

Found here.

Alexey Demin
  • 141
  • 1
  • 6
1

I had the same problem with MATE. When I clicked on hyperlinks in a PDF document in evince it opened Firefox, although I already had tried sudo update-alternatives --config x-www-browser.

The complete discussion is on github.com/mate-desktop/mate-control-center/issues/91. The solution was:

$ mate-default-applications-properties

This will launch a GUI where you can set the default browser.

Martin Thoma
  • 19,277
  • I've been trying to find the correct way to set things with MATE and failed until I found your helpful post! – rbrito Apr 30 '20 at 02:25
1

This bug was fixed a while back. The lines in file /etc/apparmor.d/abstractions/ubuntu-helpers had been included.

Xpdf had no issues, however.

But assuming that gnome-gmail and gnome-gmail-notifier are installed, and have been specified in system settings, in order to have the hyperlinks redirect, one must disable evince first, and restart apparmor afterward. (That's what worked for me anyway).

enter image description here

sudo ln -s /etc/apparmor.d/usr.bin.evince /etc/apparmor.d/disable/usr.bin.evince
sudo /etc/init.d/apparmor restart
doed
  • 111
  • Experiencing the same problem with Evince in Lubuntu 18.04 LTS, the lines sudo ln -s /etc/apparmor.d/usr.bin.evince, /etc/apparmor.d/disable/usr.bin.evince, and sudo /etc/init.d/apparmor restartworked for me, but only after a reboot! – Han Leushuis Jul 24 '19 at 21:03