Add additional cleanup steps to baseline in case prev builds failed

Change-Id: Ic85cde355731bd17483aa47cd6a16f94fbff1481
diff --git a/packer/provision/baseline.sh b/packer/provision/baseline.sh
index ad502a7..f831c66 100644
--- a/packer/provision/baseline.sh
+++ b/packer/provision/baseline.sh
@@ -221,10 +221,15 @@
 
     echo "---> Updating operating system"
 
+    # clean up in case previous build(s) failed
     apt-get clean
+    apt-get purge -y
+    apt-get autoremove -y
+    rm -rf /var/lib/apt/lists/*
+
+
     apt-get update -m
     apt-get -f install || true # attempt to fix broken packages
-    apt-get install -y iso-codes python3-software-properties isoquery software-properties-common apt-transport-https
 
     # add additional repositories
     add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
@@ -235,6 +240,8 @@
     apt-get upgrade -m
     apt-get dist-upgrade -m
 
+    apt-get install -y iso-codes python3-software-properties isoquery software-properties-common apt-transport-https
+
     ensure_ubuntu_install unzip xz-utils puppet git libxml-xpath-perl
 
     echo "---> Configuring Corretto JDK Distribution"