upgrades: Drop unattended-upgrade call from dist-upgrade

unattended-upgrade will take a very long time to run, and won't be able
to upgrade most of the packages. There is not much benefit to running it
here.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2025-02-05 17:16:17 -05:00 committed by Sunil Mohan Adapa
parent d0e25e5239
commit 5544eff707
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -60,8 +60,6 @@ DIST_UPGRADE_PACKAGES_WITH_PROMPTS = [
'mumble-server', 'radicale', 'roundcube-core', 'tt-rss'
]
DIST_UPGRADE_PRE_INSTALL_PACKAGES = ['base-files']
DIST_UPGRADE_PRE_DEBCONF_SELECTIONS: list[str] = [
# Tell grub-pc to continue without installing grub again.
'grub-pc grub-pc/install_devices_empty boolean true'
@ -479,12 +477,6 @@ def _perform_dist_upgrade():
print('Updating Apt cache...', flush=True)
run_apt_command(['update'])
# Install packages that are necessary for unattended-upgrades
# to start the dist upgrade.
print(f'Upgrading packages: {DIST_UPGRADE_PRE_INSTALL_PACKAGES}...',
flush=True)
run_apt_command(['install'] + DIST_UPGRADE_PRE_INSTALL_PACKAGES)
# Pre-set debconf selections if they are required during the
# dist upgrade.
if DIST_UPGRADE_PRE_DEBCONF_SELECTIONS:
@ -493,13 +485,6 @@ def _perform_dist_upgrade():
f'{DIST_UPGRADE_PRE_DEBCONF_SELECTIONS}', flush=True)
debconf_set_selections(DIST_UPGRADE_PRE_DEBCONF_SELECTIONS)
# This will upgrade most of the packages.
# Previously, when dist-upgrading from bullseye to bookworm, there was
# an issue where unattended-upgrade gets stuck. See #2266. However, it
# does not get stuck when dist-upgrading from bookworm to trixie.
print('Running unattended-upgrade...', flush=True)
subprocess.run(['unattended-upgrade', '--verbose'], check=False)
# Remove obsolete packages that may prevent other packages from
# upgrading.
if DIST_UPGRADE_OBSOLETE_PACKAGES: