Skip to content

Instantly share code, notes, and snippets.

@ymek
Created October 31, 2013 21:49
Show Gist options
  • Select an option

  • Save ymek/7257791 to your computer and use it in GitHub Desktop.

Select an option

Save ymek/7257791 to your computer and use it in GitHub Desktop.
# Remove items used for building, since they aren't needed anymore
echo "removing unnessary packages"
apt-get remove -y linux-headers-$(uname -r) build-essential
apt-get autoremove -y
# Removing leftover leases and persistent rules
echo "cleaning up dhcp leases"
rm /var/lib/dhcp/*
echo "cleaning apt cache"
apt-get clean
# 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
echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
echo "pre-up sleep 2" >> /etc/network/interfaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment