unable to install snapd inside lxc ubuntu 22.04

dorijan79

Active Member
May 5, 2018
19
2
43
46
Hi to all,
I am trying to install snapd inside lxc of ubuntu 22.04. This was previously ubuntu 21.10 and everything worked fine, but after the upgrade it does not work.
I get this error:



Code:
root@ubuntu-gui:~# apt install snapd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  snapd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 21.6 MB of archives.
After this operation, 89.2 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 snapd amd64 2.55.3+22.04 [21.6 MB]
Fetched 21.6 MB in 2s (12.6 MB/s)
Selecting previously unselected package snapd.
(Reading database ... 83717 files and directories currently installed.)
Preparing to unpack .../snapd_2.55.3+22.04_amd64.deb ...
Unpacking snapd (2.55.3+22.04) ...
Setting up snapd (2.55.3+22.04) ...
apparmor_parser: Unable to replace "mount-namespace-capture-helper".  Permission denied; attempted to load a profile while confined?
apparmor_parser: Unable to replace "/usr/lib/snapd/snap-confine".  Permission denied; attempted to load a profile while confined?
Could not execute systemctl:  at /usr/bin/deb-systemd-invoke line 142.
snapd.failure.service is a disabled or a static unit, not starting it.
snapd.snap-repair.service is a disabled or a static unit, not starting it.
Could not execute systemctl:  at /usr/bin/deb-systemd-invoke line 142.
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
 
Maybe something is wrong with your apparmor.
Could you show your apparmor config and tell which ubuntu template you have installed?
 
I am experiencing the same issue. When I attempt to install snapd, I get the following messages:
Code:
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 liblzo2-2 amd64 2.10-2build3 [53.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 squashfs-tools amd64 1:4.5-3build1 [159 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 snapd amd64 2.55.5+22.04 [21.6 MB]
Fetched 21.8 MB in 1s (18.5 MB/s)
Selecting previously unselected package liblzo2-2:amd64.
(Reading database ... 17354 files and directories currently installed.)
Preparing to unpack .../liblzo2-2_2.10-2build3_amd64.deb ...
Unpacking liblzo2-2:amd64 (2.10-2build3) ...
Selecting previously unselected package squashfs-tools.
Preparing to unpack .../squashfs-tools_1%3a4.5-3build1_amd64.deb ...
Unpacking squashfs-tools (1:4.5-3build1) ...
Selecting previously unselected package snapd.
Preparing to unpack .../snapd_2.55.5+22.04_amd64.deb ...
Unpacking snapd (2.55.5+22.04) ...
Setting up liblzo2-2:amd64 (2.10-2build3) ...
Setting up squashfs-tools (1:4.5-3build1) ...
Setting up snapd (2.55.5+22.04) ...
snapd.failure.service is a disabled or a static unit not running, not starting it.
snapd.snap-repair.service is a disabled or a static unit not running, not starting it.
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4) ...
Processing triggers for libc-bin (2.35-0ubuntu3) ...

and if I try to install any snap packages with this I get the following error:
Code:
error: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount:
       /tmp/sanity-mountpoint-1006956579: mount failed: Operation not permitted.

snap/os version and apparmor_status output:

Code:
root@jammy:~# snap --version
snap    2.55.5+22.04
snapd   2.55.5+22.04
series  16
ubuntu  22.04
kernel  5.13.19-6-pve

Code:
root@jammy:~# apparmor_status
apparmor module is loaded.
13 profiles are loaded.
13 profiles are in enforce mode.
   /usr/bin/man
   /usr/lib/NetworkManager/nm-dhcp-client.action
   /usr/lib/NetworkManager/nm-dhcp-helper
   /usr/lib/connman/scripts/dhclient-script
   /usr/lib/snapd/snap-confine
   /usr/lib/snapd/snap-confine//mount-namespace-capture-helper
   /{,usr/}sbin/dhclient
   lsb_release
   man_filter
   man_groff
   nvidia_modprobe
   nvidia_modprobe//kmod
   tcpdump
0 profiles are in complain mode.
0 profiles are in kill mode.
0 profiles are in unconfined 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.
0 processes are in mixed mode.
0 processes are in kill mode.
 
Last edited:
and if I try to install any snap packages with this I get the following error:
Code:
error: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount:
/tmp/sanity-mountpoint-1006956579: mount failed: Operation not permitted.
Maybe this will work:
Code:
apt install libsquashfuse0 squashfuse fuse
apt install snapd
 
It doesn't work for a privileged container, at least I can't get it to work :) I'm trying to set up Tautulli in an LXC container if anyone knows how...