Skip to content

Instantly share code, notes, and snippets.

@jasper-lyons
Created September 28, 2014 12:20
Show Gist options
  • Save jasper-lyons/c4ceaa8556a9c2d9e78c to your computer and use it in GitHub Desktop.
Save jasper-lyons/c4ceaa8556a9c2d9e78c to your computer and use it in GitHub Desktop.
Safely remove / purge old linux headers.
dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r) | xargs sudo apt-get -y purge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment