package ubuntu-advantage-tools 27.14.4 failed to install/upgrade: le sous-processus paquet ubuntu-advantage-tools script pre-removal installé a renvoyé un état de sortie d'erreur 1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Low
|
Grant Orndorff | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Mantic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
If somehow the prerm script ran while the Depends of u-a-t weren't installed, then it would crash.
More generally, the prerm script is unnecessarily bloated by using python and importing many modules it doesn't use.
The fix reimplements the python function from the old prerm in shell. This avoids running python at all.
[ Test Plan ]
In a lxd container:
1. interfere with the python3-apt installation somehow (e.g. `rm -rf /usr/lib/
2. execute the u-a-t.prerm script `apt remove ubuntu-
Without the fix, you'll see an error.
[ Where problems could occur ]
Uninstalling ubuntu-
The shell implementation also has a hardcoded list of services to try to remove list files for. If this becomes out of date, then some list files may get left behind
[ Other Info ]
The initial case that caused this bug to be reported was removing python3 from the system. I couldn't reproduce the behavior by trying it myself, and that isn't really a supported operation anyway. The bug was only kept open to represent the possibility of making the prerm script have less dependencies and be leaner.
[Original Description]
package ubuntu-
ProblemType: Package
DistroRelease: Ubuntu 23.04
Package: ubuntu-
ProcVersionSign
Uname: Linux 5.19.0-21-generic x86_64
ApportVersion: 2.26.1-0ubuntu2
Architecture: amd64
CasperMD5CheckR
Date: Tue May 30 16:01:59 2023
ErrorMessage: le sous-processus paquet ubuntu-
InstallationDate: Installed on 2023-02-25 (95 days ago)
InstallationMedia: Ubuntu 23.04 "Lunar Lobster" - Alpha amd64 (20230216)
Python3Details: /usr/bin/
PythonDetails: N/A
RebootRequiredPkgs: Error: path contained symlinks.
RelatedPackageV
dpkg 1.21.21ubuntu1
apt 2.6.0
SourcePackage: ubuntu-
Title: package ubuntu-
UpgradeStatus: No upgrade log present (probably fresh install)
cloud-id.txt-error: Invalid command specified 'cloud-id'.
livepatch-
uaclient.conf:
contract_url: https:/
log_level: debug
tags: | removed: need-amd64-retrace |
Changed in ubuntu-advantage-tools (Ubuntu): | |
assignee: | nobody → Grant Orndorff (orndorffgrant) |
description: | updated |
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 :)