Debian Mint openSUSE Red Hat Ubuntu

How to Setup Automatic Kernel Updates on Linux

How to Setup Automatic Kernel Updates on Linux

Introduction

We can use apt, yum or kexec to update the Linux kernel but when managing a lot of servers, it takes a lot of time.

We must reboot the system if the update manually. This makes you must wait so long. And it also has low security that hackers can attack the system at any time during the break. When you manage a lot of servers, automatic updating the kernel is a better option.

Below is the guide on how to update kernel automatically on Linux as we go through below.

Canonical Livepatch

Canonical Livepatch is a running kernel patching service without rebooting the Ubuntu system. Livepatch is a free service and can use up to 3 Ubuntu systems.

Before installing the service, you must get a livepatch token from the https://auth.livepatch.canonical.com/

Click to the Ubuntu user then click to the Get your Livepatch token.

Create a new account.

Then go back to the link https://auth.livepatch.canonical.com/ and Get your Livepatch token.

Run:

$ sudo snap install canonical-livepatch

$ sudo canonical-livepatch enable <your-key>

Checking service information:

$ sudo canonical-livepatch status --verbose

Output:

To unregister a machine, run:

$ sudo canonical-livepatch disable <your-key>

KernelCare

KernelCare is based on Ubuntu, CentOS, Debian, and other Linux distributions. If you are a hosting provider or business, you should use it.

Run the wget command to install it:

$ wget -qq -O - https://kernelcare.com/installer | bash

If you’re using a key-based license, run:

$ /usr/bin/kcarectl --register <your-key>

You can get <your-key> from https://tuxcare.com/live-patching-services/kernelcare-enterprise/

To check if the running kernel is supported by KernelCare:

$ curl -s -L https://kernelcare.com/checker | python

Unregistering a server:

$ sudo kcarectl --unregister

Checking service information:

$ sudo kcarectl --info

Updating manually, run:

$ /usr/bin/kcarectl --update

Conclusion

You have just seen detailed instructions on how to set up automatic kernel updates on Linux.

Thank you for reading.

Similar Posts