Cannot delete snapd inside an LXD container

I would like to completely remove snapd in a LXD guest that comes in an official ubuntu:20.04 image.

First step is to remove the lxd snap:

pietro@lxd-host:~$ lxc --version
pietro@lxd-host:~$ lxc exec lxd-guest --project home-services bash
root@lxd-guest:~# snap list
Name    Version   Rev    Tracking       Publisher   Notes
core20  20220304  1376   latest/stable  canonical✓  base
lxd     4.0.9     22526  4.0/stable/…   canonical✓  disabled
snapd   2.54.4    15177  latest/stable  canonical✓  snapd
root@lxd-guest:~# snap remove --purge lxd
error: cannot perform the following tasks:
- Remove data for snap "lxd" (22526) (unlinkat /var/snap/lxd/common/var/lib/lxcfs/proc/cpuinfo: function not implemented)

Any hint?

Ah yeah, the fix for that isn’t in 4.0.x yet, should be next time we update it.
Until then, you can umount /var/snap/lxd/common/var/lib/lxd prior to removing the snap, that should do the trick.

Ok, the workaround works fine with umount /var/snap/lxd/common/var/lib/lx**cfs**

Thanks for the prompt reply!