diskimage-builder/elements/yum/pre-install.d/01-yum-keepcache
Monty Taylor 9cd5068854 Remove use of sudo from yum pre and post elements
sudo is not needed, since in-chroot elements are run in the context
of the root user. Furthermore, sudo in pre-install is problematic as
sudo may not have been installed yet (imagine a debootstrap build)

Change-Id: Ib5c7e176a90fe3b8fa9c3cd702d3d815df54f472
2014-11-28 11:01:40 -05:00

8 lines
161 B
Bash
Executable File

#!/bin/bash
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