Fix centos6 image updates on hpcloud

The "yum repolist" command was failing with what I think was the
same error that the update command was designed to fix.  I am
unsure how or if that ever worked correctly, or what might have
changed to cause it to start impacting that command.

At any rate, specifying "epel*" as the repo name to disable will
cause the update command to work regardless of whether it is
installed.

Change-Id: I1d978ade76ec78e8895e00bbf64e5e40529223f8
This commit is contained in:
James E. Blair 2015-01-30 15:07:52 -08:00
parent 79be3ccc99
commit 311aff2fce

View File

@ -40,13 +40,10 @@ if [ -f /etc/redhat-release ]; then
if grep -q 'CentOS release 6' /etc/redhat-release; then
# chicken-and-egg ... hp cloud image has EPEL installed, but
# we can't connect to it...
# However, if we're not on an hp cloud image, we may not have
# epel and --disablerepo will fail
if yum repolist | grep epel &> /dev/null ; then
sudo yum --disablerepo=epel update -y ca-certificates
else
sudo yum update -y ca-certificates
fi
# Note 'epel*' will match 0 or more repositories named epel,
# so it will work regardless of whether epel is actually
# installed.
sudo yum --disablerepo=epel* update -y ca-certificates
fi
fi