Skip to content

Instantly share code, notes, and snippets.

@pojntfx
Last active April 24, 2024 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pojntfx/89a636ac5835f8989670967e16776c75 to your computer and use it in GitHub Desktop.
Save pojntfx/89a636ac5835f8989670967e16776c75 to your computer and use it in GitHub Desktop.
Uninstall an old kernel version from a DNF-based system bypassing `kernel` package deletion protection
#!/bin/bash
uname -r # Get installed kernels - make sure that there is at least one more kernel than the one you're removing!
sudo rpm -e kernel-6.7.0_rc6_pvm_host_fedora_baremetal-1.x86_64
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment