6

我使用 snap 已经有一段时间了,但是最近一次升级后,当我尝试打开任何应用程序时出现此错误

Snap-confine has elevated permissions and is not confined but should be.
Refusing to continue to avoid permission escalation attacks

我尝试了各种修复,但情况越来越糟。关于我应该做什么的任何想法?

我也尝试过sudo apt purge snapd snap-confine && sudo apt install -y snapd,但是当我尝试打开 pycharm-community 时,它什么也没做。

4

5 回答 5

18
sudo apparmor_parser -r /etc/apparmor.d/*snap-confine*
sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/snap-confine*

修复它。无需重新启动。

于 2022-02-10T12:42:37.350 回答
4

这对我有用

service snapd.apparmor start 

(它需要根。)

于 2021-11-22T19:54:11.940 回答
2
systemctl enable --now apparmor.service    
systemctl enable --now snapd.apparmor.service

从这里

于 2021-11-28T07:32:54.307 回答
1
sudo systemctl start apparmor 
sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/*
于 2022-01-16T20:55:21.780 回答
0

In my case it was caused by a bad AppArmor profile being present and loaded in complain (or enforce?) mode in

/etc/apparmor.d/usr.bin.snap

This apparently lead to snap not being able to determine the number of the snap and therefor caused a bad profile to be added to AppArmor.

"aa-status" outputed lines such as:

/usr/bin/snap//null-/usr/lib/snapd/snap-confine

for being in enforce mode

I moved that file (/etc/apparmor.d/usr.bin.snap) to my home directory, ran "sudo aa-remove-unknown" and "sudo systemctl restart apparmor" after which everything was back to normal.

However I don't know the origins of /etc/apparmor.d/usr.bin.snap so keep in mind that there might be something wrong with the system.

于 2022-02-28T00:37:46.537 回答