Fix native package installation on RHEL. (#19643)
- On all RHEL versions, correctly pull the EPEL release package from the Fedora project, since RHEL does not include it in their repos. - On RHEL 9 and newer, as well as clones, enable the CodeReady Builder repo, which is apparently required there to make EPEL work at all, before installing EPEL.
Austin S. Hemmelgarn committed
Feb 19, 2025 at 10:11 UTC
1786e91e91c2e7d38df9862b0bd0a629343eb14b
1 file changed
+16
-1
packaging/installer/kickstart.sh
+16
-1
@@ -1515,7 +1515,22 @@ check_special_native_deps() {
1515
if [ "${DISTRO_COMPAT_NAME}" = "centos" ] && [ "${SYSVERSION}" -gt 6 ]; then
1516
progress "EPEL is required on this system, checking if it’s available."
1517
1518
- if LC_ALL=C ${pm_cmd} search --nogpgcheck -v epel-release | grep -q "No matches found"; then
1518
+ if [ "${SYSVERSION}" -ge 9 ]; then
1519
+ progress "EPEL support requires CodeReady Builder repo on this system, attempting to enable it."
1520
+
1521
+ case "${DISTRO}" in
1522
+ rhel) run_as_root subscription-manager repos --enable "codeready-builder-for-rhel-${SYSVERSION}-$(arch)-rpms" ;;
1523
+ *) run_as_root dnf config-manager --set-enabled crb ;;
1524
+ esac
1525
+ fi
1526
+
1527
+ if [ "${DISTRO}" = "rhel" ]; then
1528
+ # shellcheck disable=SC2086
1529
+ if ! run_as_root env ${env} ${pm_cmd} ${install_subcmd} ${pkg_install_opts} "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${SYSVERSION}.noarch.rpm"; then
1530
+ warning "Failed to install EPEL, even though it is required to install native packages on this system."
1531
+ return 1
1532
+ fi
1533
+ elif LC_ALL=C ${pm_cmd} search --nogpgcheck -v epel-release | grep -q "No matches found"; then
1534
warning "Unable to find a suitable source for libuv, cannot install using native packages on this system."
1535
return 1
1536
else