From 283c9705c075a3d6e96811c821ef0980a144ed2d Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 9 Oct 2015 15:43:19 +1100 Subject: [PATCH] Reset yum/dnf cache to correct location Make sure we reset the yum/dnf cache to /var/cache/${YUM}, not just /var/cache/yum This was resulting in the F22 fedora-minimal image being larger than the base-image. Because F22 fedora-minimal does some installs with dnf when bootstrapping the chroot before we set "cachedir=" to the bind-mounted external cache, we have "/var/cache/dnf" created and and populated with the package meta-data, etc. When we globally point dnf to /var/cache/yum here, we effectively orphan the /var/cache/dnf created in those first steps. dnf doesn't care, but we end up with two copies of all the package metadata, etc in "/var/cache/dnf" & "/var/cache/yum". This also cleans up the sed a bit, by just replacing the lines. Change-Id: Icc98fe30c34cb941aed4b987647ab67ac34af15a --- elements/yum/post-install.d/99-reset-yum-conf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/elements/yum/post-install.d/99-reset-yum-conf b/elements/yum/post-install.d/99-reset-yum-conf index 9535cdde3..6a6b741ea 100755 --- a/elements/yum/post-install.d/99-reset-yum-conf +++ b/elements/yum/post-install.d/99-reset-yum-conf @@ -8,9 +8,11 @@ set -o pipefail if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then cfg=/etc/dnf/dnf.conf + cachedir=/var/cache/dnf else cfg=/etc/yum.conf + cachedir=/var/cache/yum fi -sed -i 's/keepcache=1/keepcache=0/' $cfg -sed -i 's/cachedir=\/tmp\/yum/cachedir=\/var\/cache\/yum/' $cfg +sed -i "/^keepcache/c\keepcache=0" $cfg +sed -i "/^cachedir/c\cachedir=${cachedir}" $cfg