diff --git a/platforms/common/spack_utils.sh b/platforms/common/spack_utils.sh
index 9f45ee8da70dceaca1368ceb481cf1e6226137cb..05f1ba0cd3350529336ec5c0d7eee7fcc8c8cd6d 100644
--- a/platforms/common/spack_utils.sh
+++ b/platforms/common/spack_utils.sh
@@ -4,6 +4,7 @@ function _install_spack() {
     git clone --depth 1 ${SPACK_URL} -b ${SPACK_BRANCH} ${SPACK_ROOT}
   fi
 
+  _init_spack "$SPACK_INIT_CMD" "$SPACK_ROOT"
 
   if [ ! -z "${SPACK_UPSTREAMS}" ]; then
     UPSTREAMS_CONFIG=${SPACK_ROOT}/etc/spack/upstreams.yaml
@@ -24,8 +25,6 @@ EOF
     done
   fi
 
-  _init_spack "$SPACK_INIT_CMD" "$SPACK_ROOT"
-
   if [ ! -z "${SPACK_EXTERNALS}" ] ; then
     for ext in ${SPACK_EXTERNALS}; do
       spack external find $ext