Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Bash :: Vagrant Box Cleaner for CentOS / Red Hat
# Clear yum packages
yum clean all
# Zero out the free space to save space in the final image:
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
# Removing leftover leases and persistent rules
echo "cleaning up dhcp leases"
rm -f /var/lib/dhclient/*
# Make sure Udev doesn't block our network
echo "cleaning up udev rules"
rm -rf /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm -rf /dev/.udev/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment