Removing Linux kernel from Ubuntu

I have installed a couple of custom compiled kernels on Ubuntu and want to remove them. I will breifly describe how to remove the kernels
1. Open up a terminal (Ctrl+Alt+T). Type:

$ uname -r

This will show you the kernel you’re using currently, so you don’t want to remove this.

2. Run the following command:

$ dpkg --list | grep linux-image

This will show the all the kernels that are installed. Be careful write down the names of all the kernels which you want to remove.

In my case it shows up as:

3. To remove the kernels use the command:

$ sudo apt-get purge linux-image-x.x.x.x-xyz

In my case to remove the kernel linux-image-3.5.0-17-generic (as shown in the picture above) I will use the command

$ sudo apt-get purge linux-image-3.5.0-17-generic

4. The update has to be reflected at Grub so run the command:

$ sudo update-grub2

2 thoughts on “Removing Linux kernel from Ubuntu

  1. Pingback: An easy kernel development environment | Prajosh Premdas

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s