Created
May 17, 2012 15:53
-
-
Save petemcw/2719758 to your computer and use it in GitHub Desktop.
Commands to clean a Ubuntu install for smaller Vagrant packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove items used for building, since they aren't needed anymore | |
apt-get clean | |
apt-get -y remove linux-headers-$(uname -r) build-essential | |
apt-get -y autoremove | |
# 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 /var/lib/dhcp3/* | |
# Make sure Udev doesn't block our network | |
# http://6.ptmc.org/?p=164 | |
echo "cleaning up udev rules" | |
rm /etc/udev/rules.d/70-persistent-net.rules | |
mkdir /etc/udev/rules.d/70-persistent-net.rules | |
rm -rf /dev/.udev/ | |
rm /lib/udev/rules.d/75-persistent-net-generator.rules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment