Right after upgrading a Ubuntu 21.04 to 21.10, I got this issue: Chromium/Firefox won't start. The error(seen in terminal) is:
$ firefox
cannot attach cgroup program: Operation not permitted
Right after upgrading a Ubuntu 21.04 to 21.10, I got this issue: Chromium/Firefox won't start. The error(seen in terminal) is:
$ firefox
cannot attach cgroup program: Operation not permitted
In Ubuntu 21.10, systemd is being switched to the “unified” cgroup hierarchy (cgroup v2) by default instead of (cgroup v1) in previous releases. Please see the Impish Indri Release Notes
After upgrading, apparmor does not seem to be allowing mounting cgroups version 2 FS which prevents snap based applications from starting properly.
This, however, might be solved by running this command in the terminal:
sudo dpkg-reconfigure apparmor
Select ok when prompted without adding anything.
If that did not work or for some reason you need to keep the legacy cgroup v1 hierarchy, you can select it via this kernel parameter systemd.unified_cgroup_hierarchy=0 at boot time and wait until snap is updated with full support for (cgroup v2).
systemd.unified_cgroup_hierarchy=0 and see if it works. This should enable cgroup v 1 ... if it works you can add it to grub configuration. I think snapd will be updated with support for cgroups v2 soon.
– Raffa
Oct 18 '21 at 12:43
mailspring email client and I get the same cgroup error. Not sure what to do/try next yet...
– codlord
Oct 19 '21 at 06:56
snapd is up to date as well as reinstalling sudo apt install snapd --reinstall on that single machine… snap applications might be reinstalled as well if necessary... https://askubuntu.com/a/1231238/968501
– Raffa
Oct 19 '21 at 09:28
Is it possible that you are using a Linux kernel that doesn't properly support the unified cgroup hierarchy? I had the same problem as you and it turned out that my GRUB was loading an ancient kernel, instead of a current one.
I just had the same issue after dist-upgrading from 20.04 to 22.04 - kernel was not updated, so I was still using 5.4.0-89 or 5.4.0-90. Installed 5.15.0 manually using Synaptic, then sudo update-grub and reboot.
It seems like your upgrade failed to install latest kernel version (i.e 5.10 or so).
Use uname -r to comfirm your kernel version and run
sudo apt install linux-headers-amd64 linux-image-amd64
To isntall latest image
linux-headers-amd64, just linux-image-amd64 (or corresponding in case it is another platform).
– Jan Hudec
Dec 01 '22 at 21:37