From 6c3453041c3b485e4fd59facc1082c1d9c009182 Mon Sep 17 00:00:00 2001 From: Peter Ajamian Date: Thu, 18 Nov 2021 14:11:15 +1300 Subject: [PATCH] Fix broken mirrorlist URLs from CentOS Stream repos. The mirrorlist URLs rely on variable replacements from CentOS Stream that are not valid once we have switched to Rocky Linux. To fix this we change to the baseurl instead and fix it up to not rely on those variables that have changed. --- migrate2rocky/migrate2rocky.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/migrate2rocky/migrate2rocky.sh b/migrate2rocky/migrate2rocky.sh index c6915e8..8b3917b 100644 --- a/migrate2rocky/migrate2rocky.sh +++ b/migrate2rocky/migrate2rocky.sh @@ -741,8 +741,12 @@ package_swaps() { "Could not remove packages from the rpm db: ${installed_sys_stream_repos_pkgs[@]}" fi - # Rename the stream repos with a prefix. - sed -i 's/^\[/['"$stream_prefix"'/' "${repos_files[@]}" + # Rename the stream repos with a prefix and fix the baseurl. + sed -i \ + -e 's/^\[/['"$stream_prefix"'/' \ + -e 's|^mirrorlist=|#mirrorlist=|g' \ + -e 's|^#baseurl=http://mirror.centos.org/$contentdir/$stream/|baseurl=|http://mirror.centos.org/centos/8-stream/' \ + "${repos_files[@]}" fi # Use dnf shell to swap the system packages out.