From bd4ddcf1584352a4550f0114181422c2deed37b0 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 14 Feb 2024 16:46:43 -0800 Subject: [PATCH] setup: Ensure that apt is updated before checking force upgrade If the package cache is outdated and a check is performed for whether force upgrade is needed, it might return negative. After the operation proceeds to run setup, we perform 'apt update' before 'apt install' at this point the configuration file prompt will cause failure. Tests: - Re-run firewalld upgrade from 1.3.x to 2.1.x with a re-run setup. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plinth/setup.py b/plinth/setup.py index 4c3581786..edf9e54f9 100644 --- a/plinth/setup.py +++ b/plinth/setup.py @@ -62,6 +62,7 @@ def _run_setup_on_app(app, current_version): # Check if this app needs force_upgrade. If it is needed, but not # yet supported for the new version of the package, then an # exception will be raised, so that we do not run setup. + package.refresh_package_lists() force_upgrader = ForceUpgrader.get_instance() force_upgrader.attempt_upgrade_for_app(app.app_id)