From ff9e14f3df6a7b3fa75129fac3a3e20190f43d2b Mon Sep 17 00:00:00 2001 From: Abe Binder Date: Fri, 6 Feb 2026 23:56:48 -1000 Subject: [PATCH] Resolve to STATUS_FORBIDDEN when trying to remove required packages. --- usr/lib/python3/dist-packages/mintcommon/installer/_apt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/lib/python3/dist-packages/mintcommon/installer/_apt.py b/usr/lib/python3/dist-packages/mintcommon/installer/_apt.py index dab16db..2c9d543 100644 --- a/usr/lib/python3/dist-packages/mintcommon/installer/_apt.py +++ b/usr/lib/python3/dist-packages/mintcommon/installer/_apt.py @@ -206,6 +206,7 @@ def _calculate_apt_changes(self): def on_transaction_error(self, error): # PkErrorEnums are sent from the backend mainly # PkClientErrors are related to interaction with a task/client - accept/deny, etc... + apt_cache = get_apt_cache() if error.code == packagekit.ClientError.DECLINED_SIMULATION: # canceled via additional-changes dialog return @@ -224,7 +225,7 @@ def on_transaction_error(self, error): # user navigated away before simulation was complete, etc... return - if real_code == packagekit.ErrorEnum.CANNOT_REMOVE_SYSTEM_PACKAGE or self.task.pkginfo.name in CRITICAL_PACKAGES: + if real_code == packagekit.ErrorEnum.CANNOT_REMOVE_SYSTEM_PACKAGE or self._is_critical_package(apt_cache[self.task.pkginfo.name]): self.task.info_ready_status = self.task.STATUS_FORBIDDEN if self.task.info_ready_status == self.task.STATUS_NONE: