Skip to content

Instantly share code, notes, and snippets.

@bburdiliak
Created October 7, 2015 09:01
Show Gist options
  • Save bburdiliak/213bce38e4b3240c4853 to your computer and use it in GitHub Desktop.
Save bburdiliak/213bce38e4b3240c4853 to your computer and use it in GitHub Desktop.
remove images and headers of old kernels
echo $(dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p') $(dpkg --list | grep linux-headers | awk '{ print $2 }' | sort -V | sed -n '/'"$(uname -r | sed "s/\([0-9.-]*\)-\([^0-9]\+\)/\1/")"'/q;p') | xargs sudo apt-get -y purge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment