Created
October 20, 2012 03:48
-
-
Save zhaostu/3921939 to your computer and use it in GitHub Desktop.
One-liner to remove old Linux kernels in Ubuntu
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
## Note: This is only tested in the latest Ubuntu distributions. | |
## Please make sure packages to be removed are correct. | |
## http://stuzhao.blogspot.com/2012/10/remove-old-linux-kernels-in-ubuntu.html | |
dpkg -l | awk '{print $2}' | grep "linux-\(image\|headers\)-[0-9]" | grep -v `uname -r | sed s/-generic//` | xargs sudo apt-get purge -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment