From eba4a05a3fbec87f94349459a829373fe4626491 Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Sun, 3 May 2026 11:05:12 -0700 Subject: [PATCH] checkAPT: handle packages without a candidate version Skip installed packages whose apt cache candidate is None instead of crashing with 'NoneType has no attribute version'. This can happen when a package is orphaned or removed from the configured repositories, and previously caused the entire update list refresh to fail. Closes #1059 Signed-off-by: SAY-5 --- usr/lib/linuxmint/mintUpdate/checkAPT.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr/lib/linuxmint/mintUpdate/checkAPT.py b/usr/lib/linuxmint/mintUpdate/checkAPT.py index 43d77db8..463fafa1 100755 --- a/usr/lib/linuxmint/mintUpdate/checkAPT.py +++ b/usr/lib/linuxmint/mintUpdate/checkAPT.py @@ -52,6 +52,12 @@ def find_changes(self): # Package updates for pkg in changes: + if pkg.candidate is None: + # Installed package has no candidate version (e.g. orphaned + # or removed from the repositories). Skip it so the rest of + # the update list can still be refreshed. + print("Skipping package without candidate version: %s" % pkg.name) + continue if (pkg.is_installed and pkg.candidate.version != pkg.installed.version): if (pkg.marked_upgrade or pkg.marked_downgrade): self.add_update(pkg)