{"id":9462,"date":"2021-08-23T14:33:33","date_gmt":"2021-08-23T14:33:33","guid":{"rendered":"https:\/\/linuxways.net\/?p=9462"},"modified":"2021-08-23T14:33:33","modified_gmt":"2021-08-23T14:33:33","slug":"how-to-setup-automatic-kernel-updates-on-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-setup-automatic-kernel-updates-on-linux\/","title":{"rendered":"How to Setup Automatic Kernel Updates on Linux"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>Below is the guide on how to update kernel automatically on Linux as we go through below.<\/p>\n<h2>Canonical Livepatch<\/h2>\n<p>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.<\/p>\n<p>Before installing the service, you must get a livepatch token from the <a href=\"https:\/\/auth.livepatch.canonical.com\/\">https:\/\/auth.livepatch.canonical.com\/<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1919\" height=\"946\" class=\"wp-image-9463\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-392.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-392.png 1919w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-392-300x148.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-392-1024x505.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-392-768x379.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-392-1536x757.png 1536w\" sizes=\"auto, (max-width: 1919px) 100vw, 1919px\" \/><\/p>\n<p>Click to the <strong>Ubuntu user<\/strong> then click to the <strong>Get your Livepatch token<\/strong>.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"1919\" height=\"945\" class=\"wp-image-9464\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-393.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-393.png 1919w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-393-300x148.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-393-1024x504.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-393-768x378.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-393-1536x756.png 1536w\" sizes=\"auto, (max-width: 1919px) 100vw, 1919px\" \/><\/strong><\/p>\n<p>Create a new account.<\/p>\n<p>Then go back to the link <a href=\"https:\/\/auth.livepatch.canonical.com\/\">https:\/\/auth.livepatch.canonical.com\/<\/a> and <strong>Get your Livepatch token<\/strong>. <img loading=\"lazy\" decoding=\"async\" width=\"1919\" height=\"945\" class=\"wp-image-9465\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-19.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-19.jpeg 1919w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-19-300x148.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-19-1024x504.jpeg 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-19-768x378.jpeg 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-19-1536x756.jpeg 1536w\" sizes=\"auto, (max-width: 1919px) 100vw, 1919px\" \/><\/p>\n<p>Run:<\/p>\n<pre>$ sudo snap install canonical-livepatch<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"993\" height=\"112\" class=\"wp-image-9466\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-394.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-394.png 993w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-394-300x34.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-394-768x87.png 768w\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" \/><\/p>\n<pre>$ sudo canonical-livepatch enable &lt;your-key&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"993\" height=\"87\" class=\"wp-image-9467\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-20.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-20.jpeg 993w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-20-300x26.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-20-768x67.jpeg 768w\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" \/><\/p>\n<p>Checking service information:<\/p>\n<pre>$ sudo canonical-livepatch status --verbose<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"993\" height=\"568\" class=\"wp-image-9468\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-21.jpeg\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-21.jpeg 993w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-21-300x172.jpeg 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-21-768x439.jpeg 768w\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" \/><\/p>\n<p>To unregister a machine, run:<\/p>\n<pre>$ sudo canonical-livepatch disable &lt;your-key&gt;<\/pre>\n<h2>KernelCare<\/h2>\n<p>KernelCare is based on Ubuntu, CentOS, Debian, and other Linux distributions. If you are a hosting provider or business, you should use it.<\/p>\n<p>Run the wget command to install it:<\/p>\n<pre>$ wget -qq -O - https:\/\/kernelcare.com\/installer | bash<\/pre>\n<p>If you\u2019re using a key-based license, run:<\/p>\n<pre>$ \/usr\/bin\/kcarectl --register &lt;your-key&gt;<\/pre>\n<p>You can get &lt;your-key&gt; from <a href=\"https:\/\/tuxcare.com\/live-patching-services\/kernelcare-enterprise\/\">https:\/\/tuxcare.com\/live-patching-services\/kernelcare-enterprise\/<\/a><\/p>\n<p>To check if the running kernel is supported by KernelCare:<\/p>\n<pre>$ curl -s -L https:\/\/kernelcare.com\/checker | python<\/pre>\n<p>Unregistering a server:<\/p>\n<pre>$ sudo kcarectl --unregister<\/pre>\n<p>Checking service information:<\/p>\n<pre>$ sudo kcarectl --info<\/pre>\n<p>Updating manually, run:<\/p>\n<pre>$ \/usr\/bin\/kcarectl --update<\/pre>\n<h2>Conclusion<\/h2>\n<p>You have just seen detailed instructions on how to set up automatic kernel updates on Linux.<\/p>\n<p>Thank you for reading.<\/p>","protected":false},"excerpt":{"rendered":"<p>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&hellip;<\/p>","protected":false},"author":1,"featured_media":9599,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5,83,165,2],"tags":[497],"class_list":["post-9462","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","category-mint","category-opensuse","category-red-hat","category-ubuntu","tag-kernel-updates"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/9462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=9462"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/9462\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/9599"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=9462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=9462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=9462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}