March 18, 2017 · Fedora

Fedora /boot clean up script

  1. Check out your current kernel
    uname -r
    
  2. Check out what is up in your system
    rqm -q kernel
    
  3. Clean up the kernels
    sudo yum remove kernel-XXX #manually replace it as unwanted kernel numbers
    sudo yum remove kernel-3.7.8-202.fc18.x86_64 #Example
    
  4. Confirm Clean up the kernels at /boot
    cd /boot;ls|grep XXX #manually replace it as unwanted kernel numbers
    cd /boot;ls|grep 3.7.8 #Example
    
  5. Remove it
    cd /boot;sudo rm -rf $(ls|grep 3.7.8)
    
  6. Reload grub2
    sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
    

More
https://ask.fedoraproject.org/en/question/23316/how-to-delete-old-kernel-version-from-grub/
https://ask.fedoraproject.org/en/question/80362/how-do-i-update-grub-in-fedora-23/