Skip to content

Instantly share code, notes, and snippets.

@rugbyprof
Created January 26, 2012 00:21
Show Gist options
  • Save rugbyprof/1679965 to your computer and use it in GitHub Desktop.
Save rugbyprof/1679965 to your computer and use it in GitHub Desktop.
Ubuntu Cleanup: How to Remove All Unused Linux Kernel Headers, Images and Modules
//Credit goes to - http://ubuntugenius.wordpress.com
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment