13

When I click on a link in a PDF document in Evince, it does not work. Instead, I only see cursor turning into a spinner and a message appearing in the terminal:

env: ‘/snap/bin/firefox’: Permission denied

The closest thing I have found is the following bug report for evince itself https://gitlab.gnome.org/GNOME/evince/-/issues/1090

which suggests that the problem is in the AppArmor profiles that do not allow Evince to run programs in the home directory.

How can I solve this?

I use Ubuntu 21.10 with Firefox installed from Snaps

Update Nov 2023 The bug have been fixed in Ubuntu 23.10. For bug discussion see https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1794064

2 Answers2

4

This env: ‘/snap/bin/firefox’: Permission denied or env: ‘/snap/bin/chromium’: Permission denied issue in evince launched through a terminal can be traced back to apparmor. Doing tail -f /var/log/syslog | grep -i apparmor (from here), you may find a line where the following appears apparmor="DENIED" operation="exec" name="/usr/bin/snap" profile="/usr/bin/evince" comm="env".

This can maybe be fixed by tuning the /etc/apparmor.d/usr.bin.evince profile, or by a modification of the abstractions like /etc/apparmor.d/abstractions/ubuntu-helpers or /etc/apparmor.d/abstractions/ubuntu-browsers (e.g. here or there).

A radical change which worked for me but may lead to security issues is to just disable apparmor for evince with sudo ln -s /etc/apparmor.d/usr.bin.evince /etc/apparmor.d/disable/usr.bin.evince. It it written there that sudo service apparmor restart would then engage the changes but a full computer restart was needed in my case.

EDIT: A somewhat less radical move could be to add a /usr/bin/snap Ux, line towards the end of the /usr/bin/evince {...} block of /etc/apparmor.d/usr.bin.evince (see here) and restarting the service with sudo service apparmor restart. That may still not be entirely safe, though.

gdu
  • 41
1

Try uninstalling Evince from APT and installing it from Snap:

sudo apt remote evince
sudo snap install evince

You may need to log out and in again. You may also need to reconfigure the file type associations.

This was suggested in the bug report discussion. Apparently, at the moment, you need either Evince and your browser from APT, or both from snap.

MakisH
  • 1,102
  • Update: I reverted to Evince from apt, as I then had other issues integrating with the rest of the system. – MakisH Nov 24 '22 at 10:38
  • Update 2: In case that is an option for you to consider another PDF reader, Okular from APT works just fine. – MakisH Feb 19 '23 at 08:41