Created
August 10, 2017 07:26
-
-
Save mahfuzul/b1eff5c8031cc9426a0e23e16d4018f3 to your computer and use it in GitHub Desktop.
Ubuntu Cleanup: How to Remove All Unused Linux Kernel Headers, Images and Modules
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
##Ubuntu Cleanup: How to Remove All Unused Linux Kernel Headers, Images and Modules | |
#First check uname -a to check your current version. | |
#List Unused Linux Kernel Headers, Images and Modules | |
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | |
sudo apt-get -y purge some-kernel-package | |
#List Unused Linux Kernel Headers, Images and Modules & Remove | |
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment