Remove all unused kernels with 1 command in debian based systems

Share this Article: Facebook6Google+0Twitter4LinkedIn0Reddit0StumbleUpon20

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}

For questions please refer to our Q/A forum at :

Share this Article: Facebook6Google+2Twitter4LinkedIn0Reddit0StumbleUpon20