22.04.4 LTS snap firefox chromium 权限问题

22.04.4 LTS snap firefox chromium 权限问题

我正在运行 22.04.4 LTS 并启用 Ubuntu Pro 支持。

“突然”我的 Firefox 和 Chromium 停止启动。如果我尝试从终端启动它们,我会收到以下错误:

(base) pippo@Ganimede:~$ firefox
cannot create mount point for file "/tmp/snap.rootfs_vDF3Sz/README.md": Permission denied

(base) pippo@Ganimede:~$ chromium
cannot create mount point for file "/tmp/snap.rootfs_QFJXpv/README.md": Permission denied

我尝试刷新 snap 但是它完成了操作并显示如下信息:

(base) pippo@Ganimede:~$ sudo snap refresh
[sudo] password for pippo: 
Download snap "firefox" (4090) from channel "latest/stable"    4%  772kB/s 47.7serror: cannot perform the following tasks:
- Run post-refresh hook of "firefox" snap if present (run hook "post-refresh": cannot create mount point for file "/tmp/snap.rootfs_kHleRT/README.md": Permission denied)
- Run configure hook of "chromium" snap if present (run hook "configure": cannot create mount point for file "/tmp/snap.rootfs_IPuR2q/README.md": Permission denied)
(base) pippo@Ganimede:~$ 

如果我去读取系统日志文件,我可以找到以下几行:

Apr  6 08:31:50 Ganimede systemd[4846]: Started snap.snap-store.ubuntu-software-de50015d-5d40-460b-be18-2447e2344f53.scope.
Apr  6 08:31:50 Ganimede snap-store_ubuntu-software.desktop[11558]: cannot create mount point for file "/tmp/snap.rootfs_MwvIqr/README.md": Permission denied
Apr  6 08:31:50 Ganimede kernel: [ 3333.275378] kauditd_printk_skb: 57 callbacks suppressed
Apr  6 08:31:50 Ganimede kernel: [ 3333.275380] audit: type=1400 audit(1712385110.343:307): apparmor="DENIED" operation="capable" profile="/usr/lib/snapd/snap-confine" pid=11558 comm="snap-confine" capability=12  capname="net_admin"
Apr  6 08:31:50 Ganimede kernel: [ 3333.275385] audit: type=1400 audit(1712385110.343:308): apparmor="DENIED" operation="capable" profile="/usr/lib/snapd/snap-confine" pid=11558 comm="snap-confine" capability=38  capname="perfmon"
Apr  6 08:31:50 Ganimede kernel: [ 3333.276664] audit: type=1400 audit(1712385110.343:309): apparmor="DENIED" operation="mknod" profile="/usr/lib/snapd/snap-confine" name="/tmp/snap.rootfs_MwvIqr/README.md" pid=11558 comm="snap-confine" requested_mask="c" denied_mask="c" fsuid=0 ouid=0

在我看来这是一个 Apparmor“问题”,但是......我不知道如何修复这些错误......

有关 snap 版本以及我的系统上安装的 Firefox 和 Chromium snap 的一些详细信息:

(base) pippo@Ganimede:~$ sudo snap version
snap    2.61.3+22.04
snapd   2.61.3+22.04
series  16
ubuntu  22.04
kernel  5.15.0-101-generic
(base) pippo@Ganimede:~$
(base) pippo@Ganimede:~$ sudo snap info --verbose firefox
name:    firefox
summary: Mozilla Firefox web browser
health:
  status:  unknown
  message: health has not been set
publisher: Mozilla✓
store-url: https://snapcraft.io/firefox
contact:   https://support.mozilla.org/kb/file-bug-report-or-feature-request-mozilla
links:
  contact:
    - https://support.mozilla.org/kb/file-bug-report-or-feature-request-mozilla
  website:
    - https://www.mozilla.org/firefox/
license: unset
description: |
  Firefox is a powerful, extensible web browser with support for modern web application
  technologies.
commands:
  - firefox
  - firefox.geckodriver
notes:               
  private:           false
  confinement:       strict
  devmode:           false
  jailmode:          false
  trymode:           false
  enabled:           true
  broken:            false
  ignore-validation: false
base:         core22
snap-id:      3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk
tracking:     latest/stable
refresh-date: today at 08:00 CEST
channels:
  latest/stable:    124.0.2-1    2024-04-02 (4090) 281MB -
  latest/candidate: 124.0.2-1    2024-04-01 (4090) 281MB -
  latest/beta:      125.0b8-1    2024-04-03 (4102) 282MB -
  latest/edge:      126.0a1      2024-04-05 (4108) 302MB -
  esr/stable:       115.9.1esr-1 2024-03-22 (4032) 256MB -
  esr/candidate:    115.9.1esr-1 2024-03-22 (4032) 256MB -
  esr/beta:         ↑                                    
  esr/edge:         ↑                                    
installed:          124.0.1-1               (4033) 281MB -
(base) pippo@Ganimede:~$ sudo snap info --verbose chromium
name:    chromium
summary: Chromium web browser, open-source version of Chrome
health:
  status:  unknown
  message: health has not been set
publisher: Canonical✓
store-url: https://snapcraft.io/chromium
contact:   https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bugs?field.tag=snap
links:
  contact:
    - https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bugs?field.tag=snap
  website:
    - https://code.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source
license: unset
description: |
  An open-source browser project that aims to build a safer, faster, and more
  stable way for all Internet users to experience the web.
commands:
  - chromium.chromedriver
  - chromium
notes:               
  private:           false
  confinement:       strict
  devmode:           false
  jailmode:          false
  trymode:           false
  enabled:           true
  broken:            false
  ignore-validation: false
base:         core22
snap-id:      XKEcBqPM06H1Z7zGOdG5fbICuf8NWK5R
tracking:     latest/stable
refresh-date: today at 08:00 CEST
channels:
  latest/stable:    123.0.6312.105 2024-04-04 (2811) 168MB -
  latest/candidate: 123.0.6312.105 2024-04-03 (2811) 168MB -
  latest/beta:      124.0.6367.18  2024-04-02 (2809) 169MB -
  latest/edge:      125.0.6382.3   2024-04-02 (2810) 169MB -
installed:          123.0.6312.58             (2795) 168MB -
(base) pippo@Ganimede:~$ 

非常感谢,Arpagone

答案1

今天升级失败后,我遇到了类似的问题。在升级过程中,一个软件包(在我的情况下libkcolorpicker-qt6-0)安装失败(“尝试覆盖‘/usr/lib/x86_64-linux-gnu/libkColorPicker.so.0’,它也在软件包 libkcolorpicker0:amd64 0.1.6-2 中”)。我通过手动删除其中一个冲突的软件包并修复升级来纠正此问题:

sudo dpkg --remove libkcolorpicker0
sudo apt --fix-broken install

这触发了许多之前被卡住的更新脚本,其中一个脚本snapd发出了多个警告:

Setting up snapd (2.61.3+22.04) ...
Installing new version of config file /etc/apparmor.d/usr.lib.snapd.snap-confine.real ...
snapd.failure.service is a disabled or a static unit not running, not starting it.
snapd.snap-repair.service is a disabled or a static unit not running, not starting it.
Failed to restart snapd.mounts-pre.target: Operation refused, unit snapd.mounts-pre.target may be requested by dependency only (it is configured to refuse manual start/stop).

之后 Firefox 就可以正常启动了。我对此的解释是,最终升级snapd没有正确完成,而软件包的完整设置终于解决了问题。

我使用的是 KDE Neon 6.0,所以我的具体问题可能与您不同,但问题出现的时间和版本snapd似乎匹配。

相关内容