@@ -54,6 +54,7 @@ REMOVE_PKGS=("centos-linux-release" "centos-gpg-keys" "centos-linux-repos" \
5454 " vzlinux-release" " vzlinux-gpg-keys" " vzlinux-repos" " vzlinux-obsolete-packages" \
5555 " evolution-data-server-ui" " epel-next-release" " openssl-fips-provider" " openssl-fips-provider-so" \
5656 " fips-provider-next" )
57+ REMOVE_PKGS_EL9=(" udisks2-btrfs" )
5758REDHAT_DNF_PLUGINS=(" product-id" " subscription-manager" " upload-profile" )
5859REDHAT_REPO_FILES=(" /etc/yum.repos.d/redhat.repo" " /etc/yum.repos.d/ubi.repo" )
5960REDHAT_RHSM_RPMS=(" subscription-manager" " subscription-manager-cockpit" " cockpit" " rhc" )
@@ -745,6 +746,13 @@ remove_os_specific_packages_before_migration() {
745746 if get_status_of_stage " remove_os_specific_packages_before_migration" ; then
746747 return 0
747748 fi
749+ local -r os_version=" ${1} "
750+
751+ # Extend REMOVE_PKGS with EL9-specific packages if migrating EL9
752+ if [[ " ${os_version} " == 9* ]]; then
753+ REMOVE_PKGS+=(" ${REMOVE_PKGS_EL9[@]} " )
754+ fi
755+
748756 for i in " ${! REMOVE_PKGS[@]} " ; do
749757 if ! rpm -q " ${REMOVE_PKGS[i]} " & > /dev/null; then
750758 # remove an erased package from the list if it isn't installed
@@ -865,7 +873,7 @@ migrate_from_centos() {
865873 esac
866874 # replace OS packages with almalinux-release
867875 # and OS centos-specific packages
868- remove_os_specific_packages_before_migration
876+ remove_os_specific_packages_before_migration " ${os_version} "
869877 remove_not_needed_redhat_dirs
870878 install_almalinux_release_package " ${release_path} "
871879 case " ${os_version} " in
@@ -1009,8 +1017,8 @@ that won't boot in Secure Boot mode anymore[0m:\n"
10091017 # shellcheck disable=SC2001,SC2086
10101018 echo " $output " | sed ' s# #\n#'
10111019 echo " "
1012- echo " If you don't need them, you can remove them by using the 'dnf remove " \
1013- " $ {output}' command "
1020+ echo " If you don't need them, you can remove them by using the command: " \
1021+ " sudo dnf remove $( echo " $ {output}" | xargs ) "
10141022 fi
10151023 report_step_done " Check custom kernel"
10161024 save_status_of_stage " check_custom_kernel"
0 commit comments