4

I am trying to open Sagemath through Jupyter. I am getting the following message in Firefox:

Access to the file was denied

The file at /home/tw/.local/share/jupyter/runtime/nbserver-61611-open.html is not readable.

It may have been removed, moved, or file permissions may be preventing access.

Recently, I migrated to Ubuntu 22.04 (from 20.04). Under Ubuntu 20.04, Juypter worked finely. Also the file permissions are fine and all set to "rw" for all users. I have read somewhere that Firefox does not open hidden files anymore. I tried to change advanced settings in Firefox, without success. I could not even find the relevant advanced setting option. I cannot open the above html-file from chrome either. Reinstalling Sagemath was also not helpful.

2 Answers 2

6

In 22.04, Ubuntu ships Firefox as a snap. The snap version of Firefox has strict file permissions for the sake of security, but often it compromises the user friendliness. The solution is to replace the snap version of firefox with the apt version.

Add the Firefox PPA maintained by Mozilla team

sudo add-apt-repository ppa:mozillateam/ppa

Copy and paste the following code in a terminal (don't copy-paste line by line) to prioritize the apt version of firefox with the snap version.

echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox

Remove the snap version of firefox

sudo snap remove firefox

Install Firefox with apt.

sudo apt install firefox

This version of Firefox should update when you update the system with the update manager (but it does not automatically upgrade in the background like the snap version).

Source: OMG Ubuntu

4
  • Worked, fantastic!
    – user823
    Apr 25, 2022 at 5:20
  • After each reboot, the error message reappears, seemingly the snap installation reappears. What do I have to do to make this fix permanent? I have actually run the above script after booting each time.
    – user823
    May 1, 2022 at 8:01
  • Interesting. Are you sure that Firefox reappears in snap? Did you check snapd list? If it does reappear, consider removing snaps altogether. May 1, 2022 at 18:27
  • I switched to Jupyter Notebook, using the sagemath backend. Works finely. I would like to avoid removing snap.
    – user823
    May 24, 2022 at 14:51
1

Instead of messing with Firefox, you can access SageMath through http://localhost:8888 instead.

2
  • How does this relate to using or not using Firefox? Jun 5, 2022 at 10:22
  • 1
    @ArturMeinild The question mentions using Firefox, and the other answer suggests removing the snap version of Firefox and replacing it with the APT version. My answer offers a different solution that lets you keep the snap.
    – S.T. Veje
    Jun 5, 2022 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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