From c4d2cea3b0a05c7b9f8138b20707783cc93fe372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Tue, 8 Dec 2020 10:54:42 +0000 Subject: [PATCH] fix: packages-check: centos8: handle new repo names --- bin/admin/packages-check.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/admin/packages-check.sh b/bin/admin/packages-check.sh index 72deaf8..3bdc70a 100755 --- a/bin/admin/packages-check.sh +++ b/bin/admin/packages-check.sh @@ -85,8 +85,12 @@ elif echo "$DISTRO_LIKE" | grep -q -w rhel; then if [ "$opt_install" = 1 ]; then if [ "$DISTRO_VERSION_MAJOR" = 8 ]; then - sed -i -e 's/enabled=.*/enabled=1/g' /etc/yum.repos.d/CentOS-PowerTools.repo - sed -i -e 's/enabled=.*/enabled=1/g' /etc/yum.repos.d/CentOS-Extras.repo + # in December 2020, they added "-Linux" to their repo name, so trying both combinations + for repo in CentOS-PowerTools CentOS-Extras CentOS-Linux-PowerTools CentOS-Linux-Extras + do + test -f /etc/yum.repos.d/$repo.repo || continue + sed -i -e 's/enabled=.*/enabled=1/g' /etc/yum.repos.d/$repo.repo + done fi yum install -y epel-release # shellcheck disable=SC2086