Skip to content

Instantly share code, notes, and snippets.

@grafikchaos
Forked from petemcw/gist:2719758
Created May 17, 2012 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grafikchaos/2720827 to your computer and use it in GitHub Desktop.
Save grafikchaos/2720827 to your computer and use it in GitHub Desktop.
Commands to clean a Ubuntu install for smaller Vagrant packages
# Remove items used for building, since they aren't needed anymore
sudo apt-get clean
sudo apt-get -y remove linux-headers-$(uname -r) build-essential
sudo apt-get -y autoremove
# Zero out the free space to save space in the final image:
suod dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
# Removing leftover leases and persistent rules
echo "cleaning up dhcp leases"
sudo rm /var/lib/dhcp3/*
# Make sure Udev doesn't block our network
# http://6.ptmc.org/?p=164
echo "cleaning up udev rules"
sudo rm -rf /etc/udev/rules.d/70-persistent-net.rules
sudo mkdir /etc/udev/rules.d/70-persistent-net.rules
sudo rm -rf /dev/.udev/
sudo 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