GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Failed to query AppArmor policy: Permission denied tasksel: apt-get failed (100)

I am nesting lxc container ( c) inside lxc container (H). Host container(H) and container in host ( C) both are created with -c security.privileged=true -c security.nesting=true.

Everything is working fine in the container ( C). However, with certain commands, I am getting the following errors: ( eg tasksel running)

GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Failed to query AppArmor policy: Permission denied tasksel: apt-get failed (100)

I am unable to get the perfect solution to get rid of this error. Any help?

Same problem. Any solution?

You are trying to use tasksel, which is this one, https://wiki.debian.org/tasksel

The GDbus is about D-Bus, which is normally present on desktop environments.
tasksel appears to require it when it tries to install the desktop package selection.
But, if you do not need such a selection, it should work.
Isn’t tasksel supposed to work as well on Linux servers without any GUI component?