Skip to content

Instantly share code, notes, and snippets.

@ggrandes
Last active November 24, 2015 10:03
Show Gist options
  • Save ggrandes/c12131a78e960166f4a0 to your computer and use it in GitHub Desktop.
Save ggrandes/c12131a78e960166f4a0 to your computer and use it in GitHub Desktop.
Old Kernel Autoclean (Ubuntu)
#!/bin/bash
# In New Ubuntu Versions:
# apt-get -y autoremove
uname -a
ls -al /boot/vmlinuz-*
sudo aptitude -y purge $(ls -1 /boot/vmlinuz-* | grep -v ".efi." | grep -v -e $(uname -r) | sort | head -n -1 | sed -e 's|/boot/vmlinuz|linux-image|g')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment