Deleting old kernel

Igor Iglesias
Feb 5, 2022

--

If you are like me and like to have a separated /boot partition, it’s probable that times in time you end up running out f space to install new kernel versions.

To solve such type of problem you have to delete old versions you are not using any more.

To be easy to do that I prepared a one line command that do what you need.

dpkg -l | egrep "linux-(signed|modules|image|headers)" | grep -v $(uname -r | cut -d - -f 1) | awk {'print $2'} | xargs sudo apt purge -y

Enjoy!

--

--

Igor Iglesias

Professional with more than 10 years of experience in network management, working in large networks with multiple vendors and technologies.