无法在 Firefox 中打开 Sagemath Jupyter(升级到 22.04 后)

use*_*823 4 firefox sagemath snap jupyter

我正在尝试通过 Jupyter 打开 Sagemath。我在 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.
Run Code Online (Sandbox Code Playgroud)

最近,我迁移到 Ubuntu 22.04(从 20.04)。在 Ubuntu 20.04 下,Juypter 运行良好。文件权限也很好,所有用户都设置为“rw”。我在某处读到,Firefox 不再打开隐藏文件。我尝试更改 Firefox 中的高级设置,但没有成功。我什至找不到相关的高级设置选项。我也无法从 chrome 打开上述 html 文件。重新安装 Sagemath 也没有帮助。

Arc*_*ahi 6

在 22.04 中,Ubuntu 快速发布了 Firefox。Firefox的snap版本出于安全考虑,具有严格的文件权限,但往往会损害用户友好性。解决办法是将firefox的snap版本替换为apt版本。

添加Mozilla 团队维护的Firefox PPA

sudo add-apt-repository ppa:mozillateam/ppa
Run Code Online (Sandbox Code Playgroud)

将以下代码复制并粘贴到终端中(不要逐行复制粘贴),以优先考虑 apt 版本的 Firefox 和 snap 版本。

echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox
Run Code Online (Sandbox Code Playgroud)

删除 Firefox 的 snap 版本

sudo snap remove firefox
Run Code Online (Sandbox Code Playgroud)

使用 apt 安装 Firefox。

sudo apt install firefox
Run Code Online (Sandbox Code Playgroud)

当您使用更新管理器更新系统时,此版本的 Firefox 应该会更新(但它不会像 snap 版本那样在后台自动升级)。

来源:OMG Ubuntu