How to Remove Old Linux Kernels

How to Remove Old Linux Kernels; At some point in time, almost every Ubuntu Linux user will have updated their kernel image. After you’ve used Ubuntu Linux with the new kernel image for a while and you’re content that everything is working properly, you might want to remove the old Linux version or images that still reside on your system and appear as grub boot options.

Remove Old Linux Kernels
Easily Remove Old Linux Kernels from Ubuntu

The following process explains how to entirely remove the old Linux image version which in turn also unclutters your grub menu.

Remove Old Linux Kernels (Ubuntu)

Procedure to remove unused Linux kernels on the most recent Ubuntu builds

Note: The newer process is all inclusive and automatically updates grub once it has finished.

  1. Open a terminal window by pressing Ctrl+Alt+t
  2. Type or copy and paste the following into the terminal, and then press Enter.
sudo apt autoremove

Procedure to remove Old Linux kernels on older Ubuntu builds

The following steps are only useful on old versions of Ubuntu where autoremove didn’t work.

Make a note of your old kernel version images from the Grub Menu during boot. You can get your current running version for reference by typing uname -r in an open terminal window.

    1. Press Alt+F2 and then type Synaptic
    2. From the Menu select Search and type linux-image in the Search box.
    3. Locate your old linux-mage from the list for example: linux-image-x.x.xx-xx-xxx
    4. Right Click the images you would like to remove, select Mark for Complete Removal and then click apply to remove the old image.
    5. Open a terminal window Ctrl+Alt+t and then type the following and press Enter

Next time you reboot the Grub menu will contain only the current linux kernel image.

Note: You can also find and remove linux-headers using this method.

This concludes the simple process to remove old linux kernels or removing unused linux kernels.