Skip to content

Instantly share code, notes, and snippets.

@WarpEngineer
Last active September 13, 2016 01:11
Show Gist options
  • Save WarpEngineer/2aa20dcdcab656461b05 to your computer and use it in GitHub Desktop.
Save WarpEngineer/2aa20dcdcab656461b05 to your computer and use it in GitHub Desktop.
List all installed Linux kernel images:
dpkg --list | egrep -i --color 'linux-image|linux-headers'
Remove a single image:
apt-get --purge remove linux-image-...
Remove all:
apt-get purge $(dpkg --list |egrep 'linux-image-[0-9]' |awk '{print $3,$2}' |sort -nr |tail -n +3 |grep -v $(uname -r) |awk '{ print $2}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment