我无法再在 Ubuntu 22.04 上更新 snap 应用。如果我尝试刷新 Firefox,我会得到:
$ sudo snap refresh firefox
error: cannot perform the following tasks:
- Setup snap "firefox" (2277) security profiles (cannot setup profiles for snap "firefox": cannot load apparmor profiles: exec: "apparmor_parser": executable file not found in $PATH
apparmor_parser output:
)
即使下载基本的 Hello World 也会遇到:
$ sudo snap install hello-world
error: cannot perform the following tasks:
- Setup snap "core" (14447) security profiles (cannot setup profiles for snap "core": cannot create host snap-confine apparmor configuration: cannot reload snap-confine apparmor profile: cannot load apparmor profiles: exec: "apparmor_parser": executable file not found in $PATH
apparmor_parser output:
)
Snap 以前运行良好,但后来突然因为这些问题而停止运行。我的版本是:
$ snap --version
snap 2.57.6
snapd 2.57.6
series 16
ubuntu 22.04
kernel 5.15.0-58-generic
$ apparmor_parser --version
AppArmor parser version 3.0.4
Copyright (C) 1999-2008 Novell Inc.
Copyright 2009-2018 Canonical Ltd.
我检查了 apparmor_parser 可执行文件是否可以从$PATH
以下位置访问:
$ which apparmor_parser
/usr/sbin/apparmor_parser
$ echo "$PATH"
/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/bin:/snap/bin:/home/user/.local/bin
此时我不知道问题是什么以及如何解决它。我尝试重新安装所有内容,但仍然无法解决问题。有人可以帮忙吗?
答案1
有同样的问题。通过重新安装 AppArmor(并重新启动)解决了该问题
sudo apt reinstall --purge apparmor
答案2
我无需重启即可修复此问题。该systemd
snapd.service
文件正在使用/etc/environment
覆盖PATH
变量的文件。