diff --git a/elements/centos7/environment.d/10-centos7-distro-name.bash b/elements/centos7/environment.d/10-centos7-distro-name.bash index 16184a3f0..1afdc622e 100644 --- a/elements/centos7/environment.d/10-centos7-distro-name.bash +++ b/elements/centos7/environment.d/10-centos7-distro-name.bash @@ -1 +1,2 @@ +export DIB_RELEASE=GenericCloud export DISTRO_NAME=centos7 diff --git a/elements/rpm-distro/pre-install.d/01-override-yum-arch b/elements/rpm-distro/pre-install.d/01-override-yum-arch index 9e9576995..ff84375c6 100755 --- a/elements/rpm-distro/pre-install.d/01-override-yum-arch +++ b/elements/rpm-distro/pre-install.d/01-override-yum-arch @@ -25,7 +25,7 @@ else exit 1 fi -if [ $DIB_RELEASE -ge 22 ]; then +if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then mkdir -p /etc/dnf/vars echo $basearch > /etc/dnf/vars/basearch echo $arch > /etc/dnf/vars/basearch diff --git a/elements/yum/post-install.d/99-reset-yum-conf b/elements/yum/post-install.d/99-reset-yum-conf index e36bcc394..9535cdde3 100755 --- a/elements/yum/post-install.d/99-reset-yum-conf +++ b/elements/yum/post-install.d/99-reset-yum-conf @@ -6,7 +6,7 @@ fi set -eu set -o pipefail -if [ $DIB_RELEASE -ge 22 ]; then +if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then cfg=/etc/dnf/dnf.conf else cfg=/etc/yum.conf diff --git a/elements/yum/pre-install.d/01-yum-keepcache b/elements/yum/pre-install.d/01-yum-keepcache index f02e17e39..8105ce5e9 100755 --- a/elements/yum/pre-install.d/01-yum-keepcache +++ b/elements/yum/pre-install.d/01-yum-keepcache @@ -6,7 +6,7 @@ fi set -eu set -o pipefail -if [ $DIB_RELEASE -ge 22 ]; then +if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then # dnf is slightly different; doesn't have these by default cfg=/etc/dnf/dnf.conf echo "keepcache=1" >> $cfg