Jump to content

remove old kernels


Recommended Posts

If you go into /boot and do a ls chances are you are going to have a very long list of images sitting in there. all these images are taking up memory. In order to remove them completely. take in mind  it is always good to keep an older kernel after an upgrade in case an issue arises. but if you have the latest kernel and everything is working fine and you want to free up some space then here is the script that you will want to use to remove all of the bloat..

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
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...