Properly recognize Almalinux as an RHEL clone. (#12487)
* Properly recognize Almalinux as an RHEL clone. * Prefer DNF over YUM when available. This should make things behave more correctly.
Austin S. Hemmelgarn committed
Mar 31, 2022 at 12:51 UTC
bd36f3b97f7efad1bc9efcc60952ecb62a3e48b9
2 files changed
+7
-7
packaging/installer/install-required-packages.sh
+6
-6
@@ -198,7 +198,7 @@ get_os_release() {
198
eval "$(grep -E "^(NAME|ID|ID_LIKE|VERSION|VERSION_ID)=" "${os_release_file}")"
199
for x in "${ID}" ${ID_LIKE}; do
200
case "${x,,}" in
201
- alpine | arch | centos | clear-linux-os | debian | fedora | gentoo | manjaro | opensuse-leap | ol | rhel | rocky | sabayon | sles | suse | ubuntu)
201
+ almalinux | alpine | arch | centos | clear-linux-os | debian | fedora | gentoo | manjaro | opensuse-leap | ol | rhel | rocky | sabayon | sles | suse | ubuntu)
202
distribution="${x}"
203
version="${VERSION_ID}"
204
codename="${VERSION}"
@@ -419,12 +419,12 @@ detect_package_manager_from_distribution() {
419
fi
420
;;
421
422
- centos* | clearos* | rocky*)
422
+ centos* | clearos* | rocky* | almalinux*)
423
package_installer=""
424
tree="centos"
425
- [ -n "${dnf}" ] && package_installer="install_dnf"
425
[ -n "${yum}" ] && package_installer="install_yum"
427
- if [ "${IGNORE_INSTALLED}" -eq 0 ] && [ -z "${yum}" ]; then
426
+ [ -n "${dnf}" ] && package_installer="install_dnf"
427
+ if [ "${IGNORE_INSTALLED}" -eq 0 ] && [ -z "${package_installer}" ]; then
428
echo >&2 "command 'yum' or 'dnf' is required to install packages on a '${distribution} ${version}' system."
429
exit 1
430
fi
@@ -433,8 +433,8 @@ detect_package_manager_from_distribution() {
433
fedora* | redhat* | red\ hat* | rhel*)
434
package_installer=
435
tree="rhel"
436
- [ -n "${dnf}" ] && package_installer="install_dnf"
436
[ -n "${yum}" ] && package_installer="install_yum"
437
+ [ -n "${dnf}" ] && package_installer="install_dnf"
438
if [ "${IGNORE_INSTALLED}" -eq 0 ] && [ -z "${package_installer}" ]; then
439
echo >&2 "command 'yum' or 'dnf' is required to install packages on a '${distribution} ${version}' system."
440
exit 1
@@ -444,8 +444,8 @@ detect_package_manager_from_distribution() {
444
ol*)
445
package_installer=
446
tree="ol"
447
- [ -n "${dnf}" ] && package_installer="install_dnf"
447
[ -n "${yum}" ] && package_installer="install_yum"
448
+ [ -n "${dnf}" ] && package_installer="install_dnf"
449
if [ "${IGNORE_INSTALLED}" -eq 0 ] && [ -z "${package_installer}" ]; then
450
echo >&2 "command 'yum' or 'dnf' is required to install packages on a '${distribution} ${version}' system."
451
exit 1
packaging/installer/kickstart.sh
+1
-1
@@ -451,7 +451,7 @@ get_system_info() {
451
opensuse-leap)
452
DISTRO_COMPAT_NAME="opensuse"
453
;;
454
- rocky|rhel)
454
+ almalinux|rocky|rhel)
455
DISTRO_COMPAT_NAME="centos"
456
;;
457
*)