This bug can also be triggered if the user has a virtual python env active. The post install script uses the python version from the callers environment instead of the system version for which ubuntu-advantage- tools was installed. I think it would be safe to hardcode the python bin path in the post install script since it is built for that version only.
# python -m venv test # . test/bin/activate (test) # apt install --force-reinstall=true ubuntu-advantage-tools Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded. Need to get 0 B/686 kB of archives. After this operation, 0 B of additional disk space will be used. Preconfiguring packages ... (Reading database ... 130029 files and directories currently installed.) Preparing to unpack .../ubuntu-advantage-tools_27.2.2~18.04.1_amd64.deb ... Unpacking ubuntu-advantage-tools (27.2.2~18.04.1) over (27.2.2~18.04.1) ... Setting up ubuntu-advantage-tools (27.2.2~18.04.1) ... Traceback (most recent call last): File "<string>", line 2, in <module> ModuleNotFoundError: No module named 'uaclient' dpkg: error processing package ubuntu-advantage-tools (--configure): installed ubuntu-advantage-tools package post-installation script subprocess returned error exit status 1 Processing triggers for man-db (2.8.3-2ubuntu0.1) ... Errors were encountered while processing: ubuntu-advantage-tools E: Sub-process /usr/bin/dpkg returned an error code (1) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1930121 Title: package ubuntu-advantage-tools 27.0.2~18.04.1 - ModuleNotFoundError: No module named 'uaclient' To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1930121/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs