Created
July 30, 2018 17:07
-
-
Save vitalbh/2a90fffc62a6b2034926ff026f0f5a52 to your computer and use it in GitHub Desktop.
remove old kernels
This file contains 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
dpkg -l linux-image-\* | grep ^ii | |
kernelver=$(uname -r | sed -r 's/-[a-z]+//') | |
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver | |
#purge | |
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