Remove all unused kernels with 1 command in debian based systems


Please shareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on RedditDigg thisShare on StumbleUponShare on VKBuffer this page

As you know, everytime there is an update for the kernel, the new kernel is installed while the old one is not automaticaly uninstalled, after several kernel updates you will find a large list of old kernels in the start terminalgrub menu . So if we got no problem with the new installed kernel, we can just delete the old ones.



In my previous post i did show you how to uninstall older kernel in Ubuntu. Today I will show you another command to remove unused kernels:

sudo apt-get remove $(dpkg -l|egrep '^ii  linux-(im|he)'|awk '{print $2}'|grep -v `uname -r`)


Is done.

{module post forum}