Skip to content

How to uninstall or remove old kernels in Ubuntu

Ubuntu always keeps the old kernel even after installing a new kernel. This is done just in case the new one doesn’t work well for you.

Now if you don’t want the old kernels anymore then use the command below to remove the old kernel which you wish to remove.

$ sudo apt-get remove --purge 2.6.28-11*

replace 2.6.28-11 with the version you wish to remove.

Hope this helps…

Dipin Krishna

Written by Dipin Krishna

Senior full-stack engineer — 15 years across Django, Laravel, SwiftUI and the infrastructure underneath. Available for contract work.

Work with me →

3 comments

  1. OLDKERNELS=$(dpkg -l|awk ‘{print $2}’|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)

    sudo aptitude purge $OLDKERNELS

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.