Skip to content

Instantly share code, notes, and snippets.

@ScrambledBits
Created April 20, 2012 05:31
Show Gist options
  • Save ScrambledBits/2426308 to your computer and use it in GitHub Desktop.
Save ScrambledBits/2426308 to your computer and use it in GitHub Desktop.
Remove old kernels
#!/bin/bash
ls /boot/ | grep vmlinuz | sed 's@vmlinuz-@linux-image-@g' | grep -v `uname -r` > /tmp/kernelList
for I in `cat /tmp/kernelList`
do
aptitude remove $I
done
rm -f /tmp/kernelList
update-grub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment