Created
July 11, 2018 15:54
-
-
Save apzentral/e29e1fb631049a049653d79d2d10b827 to your computer and use it in GitHub Desktop.
Bash one-liner to delete only 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,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r | cut -d- -f-2) | xargs sudo apt-get -y purge |
Author
apzentral
commented
Jul 11, 2018
- https://askubuntu.com/questions/401581/bash-one-liner-to-delete-only-old-kernels
- https://www.pontikis.net/blog/remove-old-kernels-debian-ubuntu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment