From bc7a35a1e7f8630dca087b3f503475fabe7e85c6 Mon Sep 17 00:00:00 2001 From: Peter Ajamian Date: Thu, 15 Jul 2021 18:23:36 +1200 Subject: [PATCH] Dump DNF cache before collecting system data and dnf update instead of after. If there's going to be errors due to corrupted repos, etc we want to find out right away so we can bail before we put the system in an unstable state. To this end we dump the dnf cache right away to make sure that dnf is forced to hit the repos insteada of relying on cached data. --- migrate2rocky/migrate2rocky.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/migrate2rocky/migrate2rocky.sh b/migrate2rocky/migrate2rocky.sh index e121492..5e3a2a2 100644 --- a/migrate2rocky/migrate2rocky.sh +++ b/migrate2rocky/migrate2rocky.sh @@ -358,6 +358,9 @@ safednf () ( ) collect_system_info () { + # Dump the DNF cache first so we start with a clean slate. + infomsg $'\nRemoving dnf cache\n' + rm -rf /var/cache/{yum,dnf} # Check the efi mount first, so we can bail before wasting time on all these # other checks if it's not there. if [[ $update_efi ]]; then @@ -725,8 +728,6 @@ EOF fi # Distrosync - infomsg $'\nRemoving dnf cache\n' - rm -rf /var/cache/{yum,dnf} infomsg $'Ensuring repos are enabled before the package swap\n' safednf -y --enableplugin=config-manager config-manager \ --set-enabled "${!repo_map[@]}" || {