8

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
Raffa
  • 24,905
  • 3
  • 35
  • 79
user105939
  • 1,399
  • 5
  • 17
  • 25

4 Answers4

6

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).

Raffa
  • 24,905
  • 3
  • 35
  • 79
  • thank you for trying to help, unfortunatly it did not work, The command completed fine, it seems, but nothing changed, not even after a reboot. - full output here: https://pastebin.com/abWmgEqh – user105939 Oct 18 '21 at 12:08
  • @user105939 Try adding this kernel parameter at boot time `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
  • hmm, I've upgraded five Ubuntu installations from 21.04 to 21.10, only one failed like this - I'd rather not force it back to the cgroup v1 - this will only postpone the issue and bite me later. Any other suggestions why it fails? – user105939 Oct 18 '21 at 17:31
  • Like @user105939 I too have this issue on one PC upgraded to 21.10 but not on another so there must be something else going on here as the app does work in 21.10 at least on one of my PCs. In my case it's `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
  • @user105939 @codlord l would make sure `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
  • it's good to see I am not alone. purging firefox/chromium/snap-store, and reinstalling them did not change anything. snaps like shotcut and anbox work fine. – user105939 Oct 19 '21 at 11:56
  • I reported the bug here: https://bugs.launchpad.net/ubuntu/+bug/1948478 – user105939 Oct 22 '21 at 16:00
  • 1
    Solved the problem on my system – DarkTrick Dec 12 '21 at 04:48
6

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.

ubik
  • 76
  • 1
  • 3
    Great catch! - apparently, disc encryption made it hard for GRUB to be updated - and I was stuck at kernel 5.4.x even after the recent upgrade - booting 5.13.x – user105939 Oct 31 '21 at 20:17
3

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.

Mike Haben
  • 31
  • 1
-2

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

Ahman
  • 1
  • 1
  • Most systems shouldn't need `linux-headers-amd64`, just `linux-image-amd64` (or corresponding in case it is another platform). – Jan Hudec Dec 01 '22 at 21:37