$ sudo snap install android-studio --classic
error: system does not fully support snapd: cannot mount squashfs image using "squashfs": -----
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
-----
$ dmesg | tail
...
[854469.990241] SELinux: security_context_to_sid(system_u:object_r:snappy_snap_t:s0) failed for (dev loop0, type squashfs) errno=-22
The hello-world snap downloads and mounts the squashfs.
$ snap download hello-world
Fetching snap "hello-world"
2021/08/23 14:24:37.452618 store_download.go:482: Download size for https://api.snapcraft.io/api/v1/snaps/download/buPKUD3TKqCOgLEjjHx5kSiCpIs5cMuQ_29.snap: 20480
Fetching assertions for "hello-world"
Install the snap with:
snap ack hello-world_29.assert
snap install hello-world_29.snap
$ mkdir -v -m 555 squash
mkdir: created directory ‘squash’
$ sudo mount -v hello-world_29.snap squash
mount: /home/a-acaines/squash does not contain SELinux labels.
You just mounted an file system that supports labels which does not
contain labels, onto an SELinux box. It is likely that confined
applications will generate AVC messages and not be allowed access to
this file system. For more details see restorecon(8) and mount(8).
mount: /dev/loop0 mounted on /home/a-acaines/squash.
$ df -hT squash
Filesystem Type Size Used Avail Use% Mounted on
/dev/loop0 squashfs 128K 128K 0 100% /home/a-acaines/squash
The snappy SELinux module is not installed and manually installing it fails.
$ sudo semodule -l | fgrep snappy
$ sudo semodule -i /usr/share/selinux/packages/snappy.pp.bz2
libsemanage.semanage_make_sandbox: Could not copy files to sandbox /etc/selinux/targeted/tmp. (Input/output error).
semodule: Failed on /usr/share/selinux/packages/snappy.pp.bz2!
The snapd.service is running, however it appears to exit after testing, which appears to bne intentional and normal.
$ systemctl status snapd.service snapd.socket
● snapd.service - Snap Daemon
Loaded: loaded (/usr/lib/systemd/system/snapd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2021-08-23 14:32:44 EDT; 3s ago
Main PID: 48355 (snapd)
Tasks: 22
CGroup: /system.slice/snapd.service
└─48355 /usr/libexec/snapd/snapd
● snapd.socket - Socket activation for snappy daemon
Loaded: loaded (/usr/lib/systemd/system/snapd.socket; enabled; vendor preset: disabled)
Active: active (running) since Mon 2021-08-23 14:32:44 EDT; 3s ago
Listen: /run/snapd.socket (Stream)
/run/snapd-snap.socket (Stream)
After testing,
$ systemctl status snapd.service snapd.socket
● snapd.service - Snap Daemon
Loaded: loaded (/usr/lib/systemd/system/snapd.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Mon 2021-08-23 14:04:34 EDT; 26min ago
Process: 46024 ExecStart=/usr/libexec/snapd/snapd (code=exited, status=42)
Main PID: 46024 (code=exited, status=42)
● snapd.socket - Socket activation for snappy daemon
Loaded: loaded (/usr/lib/systemd/system/snapd.socket; enabled; vendor preset: disabled)
Active: active (listening) since Thu 2021-08-19 10:49:41 EDT; 4 days ago
Listen: /run/snapd.socket (Stream)
/run/snapd-snap.socket (Stream)
Aug 23 14:33:01 host.example.com systemd[1]: Starting Snap Daemon...
-- Subject: Unit snapd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit snapd.service has begun starting up.
Aug 23 14:33:01 host.example.com snapd[48432]: AppArmor status: apparmor not enabled
Aug 23 14:33:01 host.example.com snapd[48432]: daemon.go:248: started snapd/2.51-1.el7 (series 16; classic; devmode) centos/7 (amd64) linux/3.10.0-1160.36.2.el7.x86_.
Aug 23 14:33:01 host.example.com snapd[48432]: main.go:129: system does not fully support snapd: cannot mount squashfs image using "squashfs":
Aug 23 14:33:01 host.example.com snapd[48432]: -----
Aug 23 14:33:01 host.example.com snapd[48432]: mount: wrong fs type, bad option, bad superblock on /dev/loop0,
Aug 23 14:33:01 host.example.com snapd[48432]: missing codepage or helper program, or other error
Aug 23 14:33:01 host.example.com snapd[48432]: In some cases useful info is found in syslog - try
Aug 23 14:33:01 host.example.com snapd[48432]: dmesg | tail or so.
Aug 23 14:33:01 host.example.com snapd[48432]: -----
Aug 23 14:33:01 host.example.com snapd[48432]: daemon.go:341: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
Aug 23 14:33:01 host.example.com systemd[1]: Started Snap Daemon.
-- Subject: Unit snapd.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit snapd.service has finished starting up.
--
-- The start-up result is done.
Aug 23 14:33:06 host.example.com snapd[48432]: daemon.go:508: gracefully waiting for running hooks
Aug 23 14:33:06 host.example.com snapd[48432]: daemon.go:510: done waiting for running hooks
Aug 23 14:33:06 host.example.com snapd[48432]: daemon stop requested to wait for socket activation
The host is up-to-date and has been rebooted since updates and relevant packages were installed.
Looks like issue Error: System does not fully support snapd, but I've been unable to establish the cause in this case.
SElinux is permissive.
Packages snapd, snapd-selinux and kernel-modules are installed.
Kernel modules squashfs and loop are loaded.
The hello-world snap downloads and mounts the squashfs.
The snappy SELinux module is not installed and manually installing it fails.
The snapd.service is running, however it appears to exit after testing, which appears to bne intentional and normal.
After testing,
The host is up-to-date and has been rebooted since updates and relevant packages were installed.