How to Install and Uninstall KernelCare
In my previous article, I described what KernelCare is. In this article, I’m going to tell you how to install, uninstall, clear the KernelCare cache, and other important information regarding KernelCare. In case you’re yet to know about the product, here’s a short recap. KernelCare provides automated security updates to the Linux kernel. It offers patches and error fixes for various Linux kernels.
So, if you are looking for anything similar, you have landed upon the right page. Let’s begin without further ado.
Prerequisites to Install KernelCare
Before installing KernelCare in your Linux system, ensure that you have either of these operating systems as given below.
64-bit RHEL/CentOS 5.x, 6.x, 7.x
CloudLinux 5.x, 6.x
Debian 6.x, 7.x
Note: In case you have KernelCare installed on your machine, it might be useful to know the current KernelCare version before installing KernelCare next time. To know the current version run the below-given command as root:
Checking Kernel’s Compatibility with KernelCare
To check if your current kernel is compatible with KernelCare, you need to use the following code.
curl -s -L https://kernelcare.com/checker | python
Run the following command to install KernelCare.
curl -s -L https://kernelcare.com/installer | bash
If you use an IP-based license, you don’t need to do anything more. However, if you use a key-based license, run the following command.
/usr/bin/kcarectl --register KEY
KEY is a registration key code string. It’s given to you when you sign up to purchase or to go through a trial of KernelCare. Let’s see an example.
[[email protected]:~]/usr/bin/kcarectl --register XXXXXXXXXXX
The above example shows a registration key code string.
If you experience a “Key limit reached” error message, then you need to first unregister the server after the trial ends. To do the same type:
Checking If the Patches Applied Successfully
For checking if the patches have been applied successfully or not, use the command as given below.
Now the software will check for new patches automatically every 4 hours.
If you want to run updates manually, run:
Updating KernelCare Agent
For updating the KernelCare agent package to its latest version available, run:
dnf install -y kernelcare
This command is used for rpm-based distributions including RedHat, CentOS, etc. If you own an apt-based distribution, such as Debian, Ubuntu, etc, you need to type and run the following command.
apt-get install kernelcare
Clearing KernelCare Cache
For clearing the KernelCare cache, you need to run the code given below.
rm -rf /var/cache/kcare/patches echo 1 > /proc/sys/vm/compact_memory echo 3 > /proc/sys/vm/drop_caches kcarectl –update
If experiencing any error, you might want to uninstall KernelCare from your system. To uninstall the package, run this command given below as root.
yum remove kernelcare
Disabling KernelCare Automatic Updates
Once enabling automatic updates for KernelCare, if at any time, you want to disable the KernelCare automatic updates, run the following command.
From this article, you came to know about how to install and uninstall KernelCare on your system. We also learned about prerequisites of installing KernelCare, how you can disable automatic updates, how to check for the new and applied patches, how to clear KernelCare cache, and how you can be a KernelCare agent. It’s recommended to check your kernel’s compatibility with KernelCare before installing the product. You can easily follow the given procedure to check the compatibility. I hope you find this article useful.