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 25763e542..9e9576995 100755 --- a/elements/rpm-distro/pre-install.d/01-override-yum-arch +++ b/elements/rpm-distro/pre-install.d/01-override-yum-arch @@ -25,5 +25,11 @@ else exit 1 fi -echo $basearch > /etc/yum/vars/basearch -echo $arch > /etc/yum/vars/arch +if [ $DIB_RELEASE -ge 22 ]; then + mkdir -p /etc/dnf/vars + echo $basearch > /etc/dnf/vars/basearch + echo $arch > /etc/dnf/vars/basearch +else + echo $basearch > /etc/yum/vars/basearch + echo $arch > /etc/yum/vars/arch +fi diff --git a/elements/yum/post-install.d/99-reset-yum-conf b/elements/yum/post-install.d/99-reset-yum-conf index 23ac30f5e..e36bcc394 100755 --- a/elements/yum/post-install.d/99-reset-yum-conf +++ b/elements/yum/post-install.d/99-reset-yum-conf @@ -6,5 +6,11 @@ fi set -eu set -o pipefail -sed -i 's/keepcache=1/keepcache=0/' /etc/yum.conf -sed -i 's/cachedir=\/tmp\/yum/cachedir=\/var\/cache\/yum/' /etc/yum.conf +if [ $DIB_RELEASE -ge 22 ]; then + cfg=/etc/dnf/dnf.conf +else + cfg=/etc/yum.conf +fi + +sed -i 's/keepcache=1/keepcache=0/' $cfg +sed -i 's/cachedir=\/tmp\/yum/cachedir=\/var\/cache\/yum/' $cfg diff --git a/elements/yum/pre-install.d/01-yum-keepcache b/elements/yum/pre-install.d/01-yum-keepcache index 5386faf99..f02e17e39 100755 --- a/elements/yum/pre-install.d/01-yum-keepcache +++ b/elements/yum/pre-install.d/01-yum-keepcache @@ -6,5 +6,14 @@ fi set -eu set -o pipefail -sed -i 's/keepcache=0/keepcache=1/' /etc/yum.conf -sed -i 's/cachedir=\/var\/cache\/yum/cachedir=\/tmp\/yum/' /etc/yum.conf +if [ $DIB_RELEASE -ge 22 ]; then + # dnf is slightly different; doesn't have these by default + cfg=/etc/dnf/dnf.conf + echo "keepcache=1" >> $cfg + echo "cachedir=/tmp/yum" >> $cfg +else + cfg=/etc/yum.conf + sed -i 's/keepcache=0/keepcache=1/' $cfg + sed -i 's/cachedir=\/var\/cache\/yum/cachedir=\/tmp\/yum/' $cfg +fi +