upgrades: Hold packages one at a time

`apt-mark hold PACKAGES` accepts a list of packages. But if one of the
package is missing from the apt repository, then it will fail to hold
any of the listed packages. So it is necessary to try to hold each
package by itself.

Test:
- Run dist-upgrade from bullseye to bookworm. mumble-server package is
currently missing from bookworm, but it should not cause an error in
dist-upgrade.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy committed 2022-07-01 10:22:42 -04:00
1 parent c70006d03a
commit 892deefdca
2 files changed
+26 -13

No files matched your search

-4
View File
@@ -522,10 +522,6 @@ def _perform_dist_upgrade():
print(
'Holding packages with conffile prompts: ' +
', '.join(DIST_UPGRADE_PACKAGES_WITH_PROMPTS) + '...', flush=True)
# XXX: If any of these packages have been removed from the
# next stable release, they will causes the hold command to
# fail for all packages. So it would be safer to just hold one
# package at a time.
with apt_hold(DIST_UPGRADE_PACKAGES_WITH_PROMPTS):
print('Running apt full-upgrade...', flush=True)
run_apt_command(['full-upgrade'])