Fix installation of EPEL in recent versions

The current hard-coded rpm url does not work in CentOS/RHEL > 6.

Also we have to use dnf instead of yum in recent versions (like CentOS
>= 8).

Change-Id: I3b0be9bd864a611d330b06a95913af8a12468200
This commit is contained in:
Takashi Kajinami 2024-01-26 10:36:52 +09:00
parent 61b2b86652
commit 18b84b1d2c

View File

@ -49,11 +49,18 @@ if ! is_docker_installed; then
sudo zypper --non-interactive --gpg-auto-import-keys in docker
;;
"fedora" | "rhel" | "centos")
if [ ${platform} = "centos" ]; then
# install EPEL repo, in order to install argparse
sudo rpm -Uvh --force https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
if type "dnf" 2>/dev/null;then
export YUM=dnf
else
export YUM=yum
fi
sudo yum install docker -y
# install EPEL repo, in order to install argparse
if [ ${platform} = "centos" ]; then
sudo sudo $YUM install -y epel-release
fi
sudo $YUM install docker -y
;;
*)
echo -e "Unknown platform '$platform' for installing packages.\nAborting"