It looks like when removing python3 the order of removal of all of the reverse-dependencies put python3-apt to be removed before ubuntu-advantage-tools. That is surprising because python3-apt is a dependency of ubuntu-advantage-tools. There is a warning in the output about this at the time it removes python3-apt.
Then when it gets to removing ubuntu-advantage-tools, python3-apt is gone, so the prerm script that depends on python3-apt fails.
I don't think removing python3 in this way is generally supported on an Ubuntu system, but there is also no reason that ubuntu-advantage-tools prerm needs to use python3-apt, so this bug can represent that unnecessary dependency. We can modify the prerm script to not try to import apt.
Please let me know if I'm missing anything in this analysis :)
Thank you for the bug report judemont!
It looks like when removing python3 the order of removal of all of the reverse- dependencies put python3-apt to be removed before ubuntu- advantage- tools. That is surprising because python3-apt is a dependency of ubuntu- advantage- tools. There is a warning in the output about this at the time it removes python3-apt.
Then when it gets to removing ubuntu- advantage- tools, python3-apt is gone, so the prerm script that depends on python3-apt fails.
I don't think removing python3 in this way is generally supported on an Ubuntu system, but there is also no reason that ubuntu- advantage- tools prerm needs to use python3-apt, so this bug can represent that unnecessary dependency. We can modify the prerm script to not try to import apt.
Please let me know if I'm missing anything in this analysis :)