Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've accumulated a few old versions of Linux kernels in my /boot directory as a result of kernel upgrades via the RedHat upgrade agent. I'm now out of room in that partition. What should I do to get rid of the old unused ones? If left to my own devices, I would:
* delete any files in /boot with numbers corresponding to unwanted versions, and
* update /sbin/lilo.conf to omit references to the now-deleted versions
but I'm a little nervous about monkeying around in the /boot partition. Any advice?
Based on my experience, which is admittedly somewhat limited, you should be able to just delete those kernel images. However, if you want to be careful about it, I'd do one of two things before deleting them outright:
1) Rename the "suspect" kernel images
2) Move the images to another directory in your filesystem
Then go and modify lilo.conf. Again, if you want to be extra careful, first comment-out lines before deleting them, and make sure you can still boot.
I use redHat 8, and there are also System.map files and initrd images linked with specific kernel versions. If you have those, you can get rid of them as well.
Since kernel updates in RedHat are implemented as RPM packages, you can use RPM to uninstall unwanted ones:
rpm -qa | grep kernel
will show you all the kernel packages, and you can then use "rpm -e <name>" to remove the unwanted ones. This gets all the related files out of /boot and who knows where else, and even edits /etc/lilo.conf to remove the references.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771
Rep:
Re: deleting old kernel versions
Quote:
Originally posted by Jim Miller I've accumulated a few old versions of Linux kernels in my /boot directory as a result of kernel upgrades via the RedHat upgrade agent. I'm now out of room in that partition. What should I do to get rid of the old unused ones? If left to my own devices, I would:
* delete any files in /boot with numbers corresponding to unwanted versions, and
* update /sbin/lilo.conf to omit references to the now-deleted versions
but I'm a little nervous about monkeying around in the /boot partition. Any advice?
Thanks,
Jim
Definitely, if you can identify the old kernels. Also rm -rf /lib/modules/<old-version>/ if you want to clean up the corresponding kernel modules stored under the root partition. I'd keep one old version, so I can boot it if I mess up the running kernel and shoot myself in the foot.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.