Apparmor 在 ubuntu 17.10 中初始化失败

Apparmor 在 ubuntu 17.10 中初始化失败

安装 ubuntu 17.10 后,我在启动时开始收到此错误。以下是

$ sudo service apparmor status
    pparmor.service - AppArmor initialization
   Loaded: loaded (/lib/systemd/system/apparmor.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2017-11-07 08:48:16 EET; 10min ago
     Docs: man:apparmor(7)
           http://wiki.apparmor.net/
 Main PID: 621 (code=exited, status=123)

Nov 07 08:48:16 logician-724 apparmor[621]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Nov 07 08:48:16 logician-724 apparmor[621]: Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
Nov 07 08:48:16 logician-724 apparmor[621]: AppArmor parser error for /etc/apparmor.d/usr.bin.webbrowser-app in /etc/apparmor.d/usr.bin.webbrowser-app at line 26: Could not open '/usr/share/
Nov 07 08:48:16 logician-724 apparmor[621]: AppArmor parser error for /etc/apparmor.d/usr.lib.mediascanner-2.0.mediascanner-extractor in /etc/apparmor.d/usr.lib.mediascanner-2.0.mediascanner
Nov 07 08:48:16 logician-724 apparmor[621]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Nov 07 08:48:16 logician-724 apparmor[621]:    ...fail!
Nov 07 08:48:16 logician-724 systemd[1]: apparmor.service: Main process exited, code=exited, status=123/n/a
Nov 07 08:48:16 logician-724 systemd[1]: Failed to start AppArmor initialization.
Nov 07 08:48:16 logician-724 systemd[1]: apparmor.service: Unit entered failed state.
Nov 07 08:48:16 logician-724 systemd[1]: apparmor.service: Failed with result 'exit-code'.

答案1

我在我的三个 Ubuntu 17.10 系统上都遇到了完全相同的错误。似乎发生的是,apparmor 启动脚本返回错误,因为来自两个包“webbrowser-app”和“mediascanner2.0”的策略文件中存在错误。这两个包中的策略文件试图包含不存在目录中的文件。这是这两个包打包时出现的错误。从“sudo aa-status”的输出可以看出,该错误仅影响这两个包提供的策略。

解决方法是安装提供缺失目录的软件包“apparmor-easyprof-ubuntu”。安装此软件包后,我的系统上的错误消失了。

sudo apt install apparmor-easyprof # Ubuntu >= 18.04)

或者:

sudo apt install apparmor-easyprof-ubuntu # Ubuntu < 18.04

参考: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1554803

答案2

重新安装mediascanner2.0和删除webbrowser-app对我有用。

 sudo apt install --reinstall mediascanner2.0
 sudo apt purge webbrowser-app
 sudo apt autoremove --purge

答案3

我遇到了这个问题,并找到了以下解决方案:

apt install -y apparmor-easyprof-ubuntu

相关内容