Created
April 9, 2015 11:38
-
-
Save franciscotfmc/e2ab536a63e1614f0f54 to your computer and use it in GitHub Desktop.
Remove old kernel images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kernelver=$(uname -r | sed -r 's/-[a-z]+//') | |
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver | |
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