Merge "BGPCEP-688: Install default config for bgp/bmp"
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 8 Nov 2017 14:38:40 +0000 (14:38 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 8 Nov 2017 14:38:40 +0000 (14:38 +0000)
packer/provision/baseline.sh

index 78e3b64a87c1a3c3edeb0fd4aeaa86c8be385fa4..978296bb577415ebdce3b32e4e0414dd720577d4 100644 (file)
@@ -79,6 +79,10 @@ ensure_ubuntu_install() {
         # Retry installing package 5 times if necessary
         for i in {0..5}
         do
+
+            # Wait for any background apt processes to finish before running apt
+            while pgrep apt > /dev/null; do sleep 1; done
+
             echo "$i: Installing $pkg"
             if [ "$(dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -c "ok installed")" -eq 0 ]; then
                 apt-cache policy "$pkg"