[HOWTO] Remove unused Kernels after an update in Ubuntu

The thing that bugs me the most when Ubuntu gets updated with a new kernel is my grub gets new items in the list to choose from. This may not be irritating or problematic to many but I find it messy.

Its quite simple to remove the unused kernel updates both from the system and from the grub menu. Before doing that, it’s very important that we don’t remove a kernel which some application/component is dependent on, normally this isn’t the case, but it can happen. Also, to be on the safer side, I would advice to keep the current/latest kernel update and one of the previous updates.

To check the kernel in use, run:

$ uname -r

Now to see the list of kernels currently installed:

$ cd /boot
$ ls vmlinuz*
vmlinuz-<version1>-generic
vmlinuz-<version2>-generic
… …

From the list identify the kernel version to be removed, and run:

$ sudo apt-get remove linux-image-<version1>-generic linux-image-<version2>-generic … …

Once the above process completes, just run the following to update grub:

$ sudo update-grub

Reboot and that’s it.

KTHXBYE…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: