How to Install KernelCare and Clear Its Cache on Linux
KernelCare keeps your kernel patched without rebooting, but when you finally want to switch off the service or tidy up old patches, the cache can pile up. This article walks through installing KernelCare on both Debian‑based and RHEL‑based systems and shows a quick way to wipe its cache clean.
Installing KernelCare on Ubuntu/Debian
1. Get the signed installer
wget -O kernelcare.deb https://kernelcare.com/kc-install.sh && bash kernelcare.deb
The script pulls a verified package and sets up the APT repository, so updates stay on track.
2. Add your API key – you get one from the KernelCare portal after signing in.
sudo kc-apikey -s <YOUR_KEY>
The key ties the machine to your account; without it the service will refuse to run.
3. Enable and start the daemon
sudo systemctl enable --now kernelcare.service
Enabling at boot means you never have to remember to turn it back on after a reboot.
4. Check status
sudo kernelcarectl status
You should see “KernelCare service is running” and the current patch set.
Installing KernelCare on CentOS/RHEL
1. Install the RPM
wget https://kernelcare.com/kc-install.sh && bash kc-install.sh
The script configures the YUM repository automatically.
2. Register your API key
sudo kernelcare-apikey -s <YOUR_KEY>
3. Start the service
sudo systemctl enable --now kernelcare
4. Verify
sudo kernelcare status
Clearing KernelCare Cache
KernelCare keeps a copy of every patch it downloads in /var/cache/kernelcare. Over time that directory can grow to 200 MB or more, especially on long‑running servers.
1. Stop the daemon (you don't want new patches while cleaning).
sudo systemctl stop kernelcare.service
2. Remove the cache folder
sudo rm -rf /var/cache/kernelcare/*
This deletes all cached binaries, freeing space without touching your live kernel.
3. Restart the service to let it rebuild fresh patches if needed.
sudo systemctl start kernelcare.service
When Things Go Wrong
- If kernelcarectl status shows “failed to connect to update server”, double‑check your network proxy settings; KernelCare needs a clear path to https://updates.kernelcare.com.
- A common mishap is leaving the daemon disabled after an upgrade. Run sudo systemctl enable kernelcare.service again if you notice the service isn't active.
Real‑World Observation
I once had a production server where KernelCare was silently applying patches until a sudden power loss left the machine in an inconsistent state. The next boot revealed “kernel module load failed”. Restarting the daemon and clearing /var/cache/kernelcare resolved the issue fast, proving that a clean cache can be lifesaving.
That’s it—KernelCare is installed and your cache is gone. Keep those kernels patched and the disk tidy!