Hi, am unable to install any snap using snap install command.
am getting Apparmor errors snap install natural-reader_1_amd64.snap --dangerous
error: cannot perform the following tasks:
Setup snap “core” (4206) security profiles (cannot setup apparmor for snap “core”: cannot load apparmor profile “snap.core.hook.configure”: cannot load apparmor profile: exit status 1
apparmor_parser output:
AppArmor parser error for /var/lib/snapd/apparmor/profiles/snap.core.hook.configure in /etc/apparmor.d/tunables/global at line 15: Could not open ‘tunables/home’
)
Setup snap “core” (4206) security profiles (cannot load apparmor profile “snap.core.hook.configure”: cannot load apparmor profile: exit status 1
apparmor_parser output:
AppArmor parser error for /var/lib/snapd/apparmor/profiles/snap.core.hook.configure in /etc/apparmor.d/tunables/global at line 15: Could not open ‘tunables/home’
)
I also tried to install package from online store and am getting same error.
Please help
My snap version details:
snap 2.29.4.2
snapd 2.29.4.2
series 16
ubuntu 16.04
kernel 4.4.0-116-generic
Output of aa-status
sudo aa-status
apparmor module is loaded.
0 profiles are loaded.
0 profiles are in enforce mode.
0 profiles are in complain mode.
0 processes have profiles defined.
0 processes are in enforce mode.
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
This required file was accidentally removed from your system and you need to restore it. For your convenience, here is the contents of that file from a 16.04 system:
$ cat /etc/apparmor.d/tunables/home
# ------------------------------------------------------------------
#
# Copyright (C) 2006-2009 Novell/SUSE
# Copyright (C) 2010 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# ------------------------------------------------------------------
# @{HOME} is a space-separated list of all user home directories. While
# it doesn't refer to a specific home directory (AppArmor doesn't
# enforce discretionary access controls) it can be used as if it did
# refer to a specific home directory
@{HOME}=@{HOMEDIRS}/*/ /root/
# @{HOMEDIRS} is a space-separated list of where user home directories
# are stored, for programs that must enumerate all home directories on a
# system.
@{HOMEDIRS}=/home/
# Also, include files in tunables/home.d for site-specific adjustments to
# @{HOMEDIRS}.
#include <tunables/home.d>
If you find other files are missing, I suggest reinstalling apparmor with:
i found this file on internet and saved it in place but the error was not solved, am reinstalling apparmor and snapd.
I dont know if this will solve the issue
hi @jdstrand i reinstalled apparmor but sudo apparmor_status outputs as below :
sudo apparmor_status
apparmor module is loaded.
0 profiles are loaded.
0 profiles are in enforce mode.
0 profiles are in complain mode.
0 processes have profiles defined.
0 processes are in enforce mode.
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
Yeah, I mentioned the reboot on purpose. It is possible to do it all without a reboot, but the reinstall and reboot is much easier. You shouldn’t have had to remove snapd, but I’m glad you got it sorted!