Ubuntu – How to remove a newer kernel while booted with the older kernel

14.10kerneluninstall

I have two kernels installed on my system. 3.16… and 3.19.3…I'm running Ubuntu 14.10 and it came with the 3.16…kernel. I decided to try the latest possible kernel (3.19.3…), but I sometimes get errors and the system feels unstable. I see no reason to keep this new kernel. Is there any issue I might run into if I choose to boot into the older kernel, and then remove the newer one using say, Synaptic? Will I run into issues once I reboot, or will Ubuntu just boot automatically into the older kernel with no fuss?

Any advice on the proper procedure and what methods to best achieve my goal would be appreciated. Thanks.

Best Answer

You can remove kernels the same way you remove other packages, as long as you are not booted in that kernel.

To get a list of the kernels you have installed, use dpkg -l with a grep as in:

dpkg -l | grep linux

There you will see the list of packages that got installed.

Then use the remove command of apt-get

sudo apt-get remove linux-...<name as shown by dpkg -l>

The headers do not need to be removed, the linux-image-... are the actual binaries that need removal.

Note that apt-get should automatically re-run the necessary commands to update grub and the startup RAM disk.

Of course, if you use apt-get update + apt-get upgrade (or the auto-upgrade which does the same), the newer kernel will get re-installed...

I think you can prevent re-installation, but I do not know the command for that.