Apparmor 啟動失敗,命令列啟動,結果如下
x@x-NICEPUTER:~$ systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● apparmor.service loaded failed failed LSB: AppArmor initialization
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
x@x-NICEPUTER:~$ systemctl status apparmor.service
● apparmor.service - LSB: AppArmor initialization
Loaded: loaded (/etc/init.d/apparmor; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2016-05-03 21:52:29 MDT; 1h 15min ago
Docs: man:systemd-sysv-generator(8)
Process: 523 ExecStart=/etc/init.d/apparmor start (code=exited, status=123)
May 03 21:52:22 x-NICEPUTER apparmor[523]: 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/apparmor/hardware/graphics.d'
May 03 21:52:28 x-NICEPUTER apparmor[523]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
May 03 21:52:29 x-NICEPUTER apparmor[523]: Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
May 03 21:52:29 x-NICEPUTER apparmor[523]: 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/apparmor/hardware/graphics.d'
May 03 21:52:29 x-NICEPUTER apparmor[523]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
May 03 21:52:29 x-NICEPUTER apparmor[523]: ...fail!
May 03 21:52:29 x-NICEPUTER systemd[1]: apparmor.service: Control process exited, code=exited status=123
May 03 21:52:29 x-NICEPUTER systemd[1]: Failed to start LSB: AppArmor initialization.
May 03 21:52:29 x-NICEPUTER systemd[1]: apparmor.service: Unit entered failed state.
May 03 21:52:29 x-NICEPUTER systemd[1]: apparmor.service: Failed with result 'exit-code'.
內部不存在 目錄apparmor/hardware/
和文件 ,因此在第 26 行返回 null 並導致失敗。graphics.d
/usr/share/
#include /usr/share/apparmor/hardware/graphics.d
/etc/apparmor.d/usr.bin.webbrowser-app
我怎麼能正確解決這個問題,或至少創建一個允許apparmor.service
初始化而不會失敗的解決方法?
uname -a
Linux x-NICEPUTER 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
sudo lshw
[sudo] password for x:
x-niceputer
description: Computer
width: 64 bits
capabilities: smbios-2.4 vsyscall32
*-core
description: Motherboard
physical id: 0
*-memory
description: System memory
physical id: 0
size: 3793MiB
*-cpu
product: Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz
答案1
似乎是個已報告的錯誤(#1554803)
可以apparmor-easyprof-ubuntu
透過手動安裝或建立資料夾來解決。
sudo apt-get install apparmor-easyprof-ubuntu
答案2
就我而言,當我使用 卸載 snapd 軟體包時,問題就出現了apt-get remove snapd
。檢查系統日誌,似乎 snapd 卸載程式刪除了一些目錄,但沒有刪除引用它們的 apparmor 設定檔。我用 apparmor 修剪了包apt-get purge snapd
並重新啟動,沒有出現錯誤。
答案3
對我來說,我無法安裝任何軟體包,因為兩者ifconfig
都network-manager
無法找到/啟動我的 USB wifi 適配器。
所以@xtrchessreal的評論對我有用:
在復原模式 shell 中,建立以下目錄:
mkdir -p /usr/share/apparmor/hardware/graphics.d
mkdir -p /usr/share/apparmor/hardware/audio.d
mkdir -p /usr/share/apparmor/hardware/video.d
進而reboot
答案4
第 1 步:進入 ubuntu 的進階選項
步驟2:從Linux 4.4開始。 0-22 通用(恢復模式)
第 3 步:然後從清單中按一下 (dpkg)
步驟 4:稍等片刻,然後它不起作用 輸入 ' sudo-install-(next vesion) 16.04 of ubuntu 然後等待幾分鐘
步驟5:然後恢復並重新啟動