xci: file: Update package metadata before installing packages 57/43057/1
authorMarkos Chandras <mchandras@suse.de>
Mon, 25 Sep 2017 21:00:59 +0000 (22:00 +0100)
committerMarkos Chandras <mchandras@suse.de>
Mon, 25 Sep 2017 21:05:21 +0000 (22:05 +0100)
We may have old or no metadata for packages at all so package
installations may fail. As such, lets sync with upstream mirrors
before we try to install any packages.

Change-Id: I15f73e46d4f0cae2c50d23a92e0f4da83821039e
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/file/install-ansible.sh

index 16ff86c..85d02d0 100644 (file)
@@ -33,6 +33,7 @@ if [ -x '/usr/bin/zypper' ]; then
         [openssl]=openssl
     )
     EXTRA_PKG_DEPS=( python-xml )
+    sudo zypper -n ref
     # NOTE (cinerama): we can't install python without removing this package
     # if it exists
     if $(${CHECK_CMD} patterns-openSUSE-minimal_base-conflicts &> /dev/null); then
@@ -54,6 +55,7 @@ elif [ -x '/usr/bin/apt-get' ]; then
               [openssl]=openssl
             )
     EXTRA_PKG_DEPS=()
+    sudo apt-get update
 elif [ -x '/usr/bin/dnf' ] || [ -x '/usr/bin/yum' ]; then
     OS_FAMILY="RedHat"
     PKG_MANAGER=$(which dnf || which yum)
@@ -71,6 +73,7 @@ elif [ -x '/usr/bin/dnf' ] || [ -x '/usr/bin/yum' ]; then
         [wget]=wget
         [openssl]=openssl
     )
+    sudo yum update --assumeno
     EXTRA_PKG_DEPS=()
 else
     echo "ERROR: Supported package manager not found.  Supported: apt,yum,zypper"