Skip to content

Instantly share code, notes, and snippets.

@Pyppe
Last active December 16, 2015 00:38
Show Gist options
  • Save Pyppe/5348739 to your computer and use it in GitHub Desktop.
Save Pyppe/5348739 to your computer and use it in GitHub Desktop.
dpkg -l|egrep '^ii linux-(im|he)'|awk '{print $2}'
uname -r
# http://ubuntugenius.wordpress.com/2011/01/08/ubuntu-cleanup-how-to-remove-all-unused-linux-kernel-headers-images-and-modules/
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
And then apt-get purge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment