How to: Linux delete or remove kernel

‮l.www‬autturi.com
How to: Linux delete or remove kernel

To delete or remove a kernel from a Linux system, you can use the dpkg command to uninstall the kernel packages.

Here's an example of how to remove the currently running kernel on a Debian-based system:

  1. List the installed kernel packages:
dpkg --list | grep linux-image

This will show a list of installed kernel packages, with the currently running kernel highlighted in bold.

  1. Uninstall the kernel packages:
sudo apt-get remove linux-image-<version> linux-headers-<version>

Replace <version> with the version of the kernel you want to remove. You will need to uninstall both the linux-image and linux-headers packages for the kernel.

  1. Update the boot loader configuration:
sudo update-grub

This will update the boot loader configuration to remove the entry for the uninstalled kernel.

Note: It is generally not recommended to remove the currently running kernel, as this can potentially cause issues with the system. If you want to switch to a different kernel, it is usually safer to install the new kernel and then reboot the system to use it.

Created Time:2017-10-29 22:08:41  Author:lautturi