A practice that Linux distributions recommends is to put Linux kernel images in a separate partition that is mounted at
/boot
. It is a common problem that the
/boot
partition becomes full, which prevent any new kernel images from being installed to copied to the partition. To resolve this problem, there are commonly two solutions.
- Solution 1. Increasing the size of the
/boot
partition.
- Solution 2. Removing old kernel images from the
/boot
partition.
This post discusses Solution 2. Previously I took
a note how we may remove old kernel images and packages from Ubuntu Linux (or any Debian-based Linux distributions). In this post, I would like to take a note on removing old kernel images and packages from Fedora Linux (or any Redhat Linux-based systems). I have been used two methods that lead to the same results. I would recommend the second method for simplicity. However, if you want to know what packages and images are removed, you may want to use the first method.
-
Using
rpm
.
- First determine what Linux kernel images are present in the
/boot
partition.
$ ls /boot/vmlinu*
/boot/vmlinuz-3.14.23-100.fc19.x86_64
/boot/vmlinuz-3.17.3-200.fc20.x86_64
The above shows that we have two Linux kernels present in the /boot
partition.
Now we want to make room in the /boot
partition.
Once we make sure that we can boot from the /boot/vmlinuz-3.17.3-200.fc20.x86_64
, we can remove the
old kernel image and associated kernel package.
- We now find out what packages that we need to uninstall to remove the old kernel package, in this case,
/boot/vmlinuz-3.14.23-100.fc19.x86_64
.
$ rpm -qa | grep 3.14.23
kernel-devel-3.14.23-100.fc19.x86_64
kernel-3.14.23-100.fc19.x86_64
-
From the above, we can now remove the two packages.
$ sudo rpm -evh \
kernel-devel-3.14.23-100.fc19.x86_64 \
kernel-3.14.23-100.fc19.x86_64
Alternatively, we can also use yum
to remove the two packages.
sudo yum remove \
kernel-devel-3.14.23-100.fc19.x86_64 \
kernel-3.14.23-100.fc19.x86_64
-
Using the
yum-utils
package.
-
We first install the
yum-utils
package.
sudo yum install yum-utils
-
The
yum-utils
package has a tool called package-cleanup
. We now use it to remove old kernel images and associated packages, which is done by specifying the number of kernel images that we would like to keep in the system. In this example, we would like to keep only one kernel image. Then, we issue the following command,
sudo package-cleanup --oldkernels --count=1
I learned the method of using yum-utils
from a web post here
, which also discusses how you may configure the system to always keep a given number of kernel images and associated packages.
Thanks for sharing this- good Information! Keep up the great work, we look forward to reading more from you in the future!
ReplyDeleteRegards,
Linux Online Training | Linux Training in Hyderabad | Linux Online Training in Hyderabad | Linux Online Training in India | Linux Online Training Institutes in Hyderabad | Best Institutes for Linux in Hyderabad | Linux Training Institutes in Hyderabad | Linux Training Institutes in India | Linux Online Training hyderabad | Linux Online Training India | Best Institutes for Linux | Linux Administration Training in Hyderabad | Linux Certification Training | Linux Training in Ameerpet, Hyderabad | Red Hat Linux Training in Hyderabad | Linux Certification Training in Hyderabad | Best Linux online Training Institutes in Hyderabad | Learn Linux | Learn Linux Online
Thanks for sharing & Its Great information. And Look on right now!
ReplyDeleteCan help you BlogSpot Blog , Sbcglobal email not working on iPhone/Mac/Phone, and Sbcglobal.net not sending and receiving emails| How to Reset My Spotify Password? How to Recover My Spotify Password?