What it does:
- check's for installed kernel packages
- figures out the currently running kernel
- prompts to remove kernel packages skipping the currently running kernel
- if you opted to uninstall a kernel package it'll be removed including dependent packages (i.e. kmod-nvidia for that specific kernel) and will also remove a kernel-devel package (and dependent packages) if installed
- needs to be run as root
- of course "yum"
- Fedora :-)
- ... or a Red Hat based distro (can be overridden with "-f" to force)
As root copy the script where ever you like. I'd recommend /usr/local/bin. Then run as root "kernel-remover.sh".
If you find this useful and like to download this script, you may do so here (you'll find a gpg signed md5sum within the tar archive. My key can be found here.):
Download: kernel-remover (Updated to version 1.1 on May, 2nd 2012)
I've tested this script and it seems to work fine. It may work on other Red Hat based distros as well but I tested on Fedora 16 only. So, it *should* do no harm, but: as always you should know what you're doing and I give no warranty what so ever! Use at your own risk!