Skip to content

Instantly share code, notes, and snippets.

@fillup
Created June 30, 2014 12:59
Show Gist options
  • Save fillup/20dd13ead0f29caad950 to your computer and use it in GitHub Desktop.
Save fillup/20dd13ead0f29caad950 to your computer and use it in GitHub Desktop.
Script to clean up old kernel headers to free up space on /boot on Ubuntu
#!/bin/bash
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment