How to remove old kernels from CentOS 7
In this post, I will explain how to remove old kernels from CentOS 7. We need to install yum-utils package to remove the old kernels safely.
Please check the following steps to remove the old kernels from CentOS.
First, check the current Kernel version you are using:
uname -r
Example output:
[root@server ~]# uname -r 3.10.0-1160.53.1.el7.x86_64 [root@server ~]#
Then list all available kernels:
rmp -qa kernel
Example output:
[root@server ~]# rpm -qa kernel kernel-3.10.0-1160.45.1.el7.x86_64 kernel-3.10.0-1160.49.1.el7.x86_64 kernel-3.10.0-1160.el7.x86_64 kernel-3.10.0-1160.53.1.el7.x86_64 [root@server ~]#
Verify the old and inactive kernels from the above commands
Remove old kernels:
To remove old kernel from Redhat based systems you have to install yum-utils package. Use the following command to install it:
yum install yum-utils
Once this command is installed you can use the command package-cleanup
package-cleanup --oldkernels --count=2
–count=2 option will make sure to keep 2 kernels in the system. If you would like to remove all unused kernels, you can use –count=1. It will keep only the active kernel.
For better understanding please check the example output below:
That’s it!
Also Read:
- How to change boot order in CentOS 7 or RHEL 7
- YumRepo Error: All mirror URLs are not using ftp, http[s] or file
- Install Htop on CentOS/RHEL and Ubuntu
- Install GitLab on CentOS 7 and Derivatives
- Install GitLab on CentOS 7 and Derivatives
- Install Zabbix on CentOS 8 and Derivatives
- How to Install Kdenlive Video Editor on Ubuntu
- Install youtube-dl in Ubuntu
- How to Install BleachBit on Ubuntu and Derivatives
- How to install Rambox on Ubuntu and Derivatives
- Install Blender in Ubuntu and its derivatives
- How to install gallery-dl in Ubuntu
- Install and enable sudo command in Debian
- How to Install Kodi on Ubuntu and its Derivatives
- Install FlatPak on Ubuntu and Derivatives
- How to Install DraftSight on Ubuntu and Derivatives
- Install OpenSCAD in Ubuntu, Debian, Fedora and Arch Linux
- How to Install OpenShot on Ubuntu and Derivatives
- How to Install OpenVPN on CentOS and Derivatives
- How to install VidCutter on Ubuntu and Derivatives
- How to Install Sublime Text on Ubuntu and CentOS
- How to Install Spotify on Ubuntu and Derivatives
- Install Zabbix on CentOS 8 and Derivatives
If you like this post and wish to receive more articles from us, please like our FB page: Grepitout
Your suggestions and feedback will encourage us and help to improve further, please feel free to write your comments.
For more details on our services, please drop us an E-mail at info@grepitout.com
Add Comment