Report packages on hold, and flag held kernel packages

A held package never upgrades, and apt's simulation leaves it out, so
its updates (security ones included) appear nowhere. A leftover hold on
linux-image-amd64 or linux-generic keeps a host on its kernel while it
looks current.

The agent reports installed held packages (dpkg's "hi") as
held_packages. A held linux-* package puts the host in update with the
apt-mark unhold hint; other holds, usually deliberate, get a note. The
host page lists them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Opus 5.5 committed 2026-11-01 15:24:27 -05:00
1 parent f88261d2f5
commit 4676942108
7 files changed
+61 -1

No files matched your search

+12
View File
@@ -172,6 +172,18 @@ class AgentReportTest(AgentCase):
"libbar2", "libfoo1:amd64", "linux-headers-6.12.60+deb13-amd64",
"linux-image-6.12.60+deb13-amd64", "man-db"])
def test_held_packages(self):
with open(os.path.join(self.root, "dpkg-all"), "w") as f:
f.write("ii \tcurl\n"
"hi \tlinux-image-amd64\n"
"hi \tpostgresql-16\n"
"hn \tnot-installed\n"
"hc \tremoved-but-held\n"
"iF \tbroken\n")
r = self.report()
self.assertEqual(r["held_packages"], ["linux-image-amd64", "postgresql-16"])
self.assertEqual(r["dpkg_unfinished_packages"], ["broken"])
def test_no_unfinished_packages(self):
with open(os.path.join(self.root, "dpkg-all"), "w") as f:
f.write("ii \tcurl\nrc \told-pkg\n")