This situation causes a problem whenever trying to remove an old Python
version within an LXC container/guest.

E.g. after a dist-upgrade from Debian 10 to 11, running apt autoremove:

Removing python3.7 (3.7.3-2+deb10u3) ...
Removing libpython3.7-stdlib:amd64 (3.7.3-2+deb10u3) ...
Removing python3.7-minimal (3.7.3-2+deb10u3) ...
update-binfmts: warning: unable to open /proc/sys/fs/binfmt_misc/python3.7
for writing: Permission denied
update-binfmts: warning: unable to disable binary format python3.7
update-binfmts: exiting due to previous errors
dpkg: error processing package python3.7-minimal (--remove):
 installed python3.7-minimal package pre-removal script subprocess returned
error exit status 2
dpkg: too many errors, stopping
Errors were encountered while processing:
 python3.7-minimal
Processing was halted because there were too many errors.
E:Sub-process /usr/bin/dpkg returned an error code (1)

See also
https://bugs.launchpad.net/ubuntu/+source/binfmt-support/+bug/1862347

According to Stéphane Graber (one of the maintainers of LXC/LXD):
> that update-binfmts shouldn't be fatal
https://github.com/lxc/lxc/issues/388#issuecomment-71416534

Reply via email to