From d0bba3c41e7d1ca4e05fed2bf0470fffb06a757b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 27 Sep 2019 10:26:54 +0800 Subject: [PATCH] install-deps: do not install if rpm already installed there is chance that the system already have epel-release-latest-7.noarch.rpm installed, in that case, install-deps.sh should not fail. Signed-off-by: Kefu Chai (cherry picked from commit 45a4173bcfe15a9bf56f6aeb6e6c35386a00d1c5) --- install-deps.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install-deps.sh b/install-deps.sh index d6fc2e6b18c14..9712c1a902621 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -248,7 +248,8 @@ else if test $ID = rhel ; then $SUDO yum-config-manager --enable rhel-$MAJOR_VERSION-server-optional-rpms fi - $SUDO yum install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJOR_VERSION.noarch.rpm + rpm --quiet --query epel-release || \ + $SUDO yum -y install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-$MAJOR_VERSION.noarch.rpm $SUDO rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$MAJOR_VERSION $SUDO rm -f /etc/yum.repos.d/dl.fedoraproject.org* if test $ID = centos -a $MAJOR_VERSION = 7 ; then -- 2.39.5