{"id":21331,"date":"2026-11-22T18:52:47","date_gmt":"2026-11-22T15:52:47","guid":{"rendered":"https:\/\/www.hyyat.com\/knowledgebase\/update-linux-kernel-almalinux-rocky\/"},"modified":"2026-11-22T18:53:11","modified_gmt":"2026-11-22T15:53:11","password":"","slug":"update-linux-kernel-almalinux-rocky","status":"publish","type":"docs","link":"https:\/\/www.hyyat.com\/en\/knowledgebase\/update-linux-kernel-almalinux-rocky\/","title":{"rendered":"Updating the Linux Kernel on AlmaLinux and Rocky Linux: Check, Update, Reboot, and Roll Back"},"content":{"rendered":"<div class=\"hkb\" dir=\"ltr\">\n<div class=\"hkb-tldr\"><b>The three commands<\/b>Check the current kernel with <code>uname -r<\/code>, update it with <code>dnf update kernel<\/code>, then reboot so the new kernel runs. The system keeps the previous kernel, so if the server will not boot on the new one you can pick it from the boot menu.<\/div>\n<div class=\"hy-vid\"><div style=\"width: 1280px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-21331-1\" width=\"1280\" height=\"720\" poster=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hyyat-srv-kernel-en.jpg\" preload=\"none\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hyyat-srv-kernel-en.mp4?_=1\" \/><a href=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hyyat-srv-kernel-en.mp4\">https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hyyat-srv-kernel-en.mp4<\/a><\/video><\/div><\/div>\n<div class=\"hkb-note\"><b>The idea:<\/b> The kernel is the heart of Linux: it manages CPU, memory, disks and network. Its updates sometimes close serious security holes, but unlike most software, they only take effect after a reboot.<\/div>\n<div class=\"hkb-note warn\">This guide was originally written for CentOS. CentOS Linux has reached end of life and no longer gets updates; servers today use AlmaLinux, Rocky Linux or CloudLinux instead, and the commands below are for those. If your server is still on CentOS, a migration plan matters more than a kernel update.<\/div>\n<h2>The commands<\/h2>\n<figure class=\"hkb-fig\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hkb-sv-t-kernel.webp\" alt=\"Commands to check, update and reboot into a new kernel on AlmaLinux and Rocky Linux\" width=\"800\" height=\"451\" loading=\"lazy\" \/><\/figure>\n<ol class=\"hkb-steps\">\n<li><b>Current kernel<\/b> <code>uname -r<\/code>; note the number to compare later.<\/li>\n<li><b>Is there an update?<\/b> <code>dnf check-update kernel<\/code>.<\/li>\n<li><b>Take a safety copy<\/b> a server snapshot if available, as in <a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/vps-snapshots-instant-rollback\/\">VPS snapshots<\/a>.<\/li>\n<li><b>Update<\/b> <code>dnf update kernel<\/code>, or <code>dnf update<\/code> for the whole system.<\/li>\n<li><b>Reboot<\/b> at a quiet time; on a cPanel server, from <a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/reboot-server-from-whm\/\">WHM<\/a>.<\/li>\n<li><b>Check<\/b> <code>uname -r<\/code> should show the new number.<\/li>\n<\/ol>\n<h2>If the server will not boot on the new kernel<\/h2>\n<ol class=\"hkb-steps\">\n<li><b>Open the console<\/b> from your provider\u2019s server control panel to see the boot screen.<\/li>\n<li><b>Choose the previous kernel<\/b> from the GRUB menu at boot.<\/li>\n<li><b>Make it the default for now<\/b> <code>grubby --set-default \/boot\/vmlinuz-old-version<\/code> until you find the cause.<\/li>\n<li><b>If the menu does not appear<\/b> use <a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/vps-rescue-mode-fix-unbootable-server\/\">rescue mode<\/a> to reach the disks.<\/li>\n<\/ol>\n<h2>How many kernels are kept?<\/h2>\n<p>dnf keeps a set number of installed kernels (<code>installonly_limit<\/code> in <code>\/etc\/dnf\/dnf.conf<\/code>) and removes the oldest automatically. List them with <code>rpm -q kernel<\/code>.<\/p>\n<h2>Updating without a reboot?<\/h2>\n<p>Services such as KernelCare (paid) and kpatch apply security patches to the running kernel without a reboot. Useful for servers that cannot stop, but no substitute for a full update and reboot from time to time.<\/p>\n<h2>On a cPanel server<\/h2>\n<p>cPanel only updates the kernel if you enable it in Tweak Settings with the option to update the kernel during nightly maintenance. After a kernel update, WHM shows a message asking you to reboot.<\/p>\n<h2>Does your server need a reboot right now?<\/h2>\n<p>After many updates you may not know whether the running kernel is the newest. <code>needs-restarting<\/code> from dnf-utils tells you:<\/p>\n<pre class=\"hkb-code\">dnf install -y dnf-utils\nneeds-restarting -r     # does the system need a reboot?\nneeds-restarting -s     # which services need a restart<\/pre>\n<p>The second is handy after updating libraries such as OpenSSL: sometimes restarting the listed services is enough instead of the whole server.<\/p>\n<h2>Kernel update questions<\/h2>\n<div class=\"hkb-faq\">\n<details>\n<summary>Does a kernel update delete my files?<\/summary>\n<p>No. It adds a new kernel alongside the old one.<\/p>\n<\/details>\n<details>\n<summary>How often should I update the kernel?<\/summary>\n<p>At least whenever a security update is released, with a scheduled reboot.<\/p>\n<\/details>\n<details>\n<summary>Do I update the kernel on a VPS?<\/summary>\n<p>Yes on most modern VPS types, because each server has its own kernel. Check with uname -r before and after.<\/p>\n<\/details>\n<\/div>\n<div class=\"hkb-rel\"><b>Related guides<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/reboot-server-from-whm\/\">Rebooting Your Server from WHM: Graceful or Forceful, and What to Do If It Does Not Come Back<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/vps-rescue-mode-fix-unbootable-server\/\">Rescue Mode: Fix an Unbootable VPS and Reach Your Files<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/how-to-connect-to-a-server-via-ssh\/\">Connecting to Your Server Remotely with SSH: From Windows, macOS and Linux, and SSH Keys Instead of Passwords<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/5-tips-to-secure-your-cpanel-server\/\">Securing a cPanel Server: A Practical 10-Step Checklist in Order, from Updates to Backups<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.hyyat.com\/en\/kb\/servers-without-control-panel\/\">All server guides \u2192<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The three commandsCheck the current kernel with uname -r, update it with dnf update kernel, then reboot so the new kernel runs. The system keeps the previous kernel, so if the server will not boot on the new one you can pick it from the boot menu. The idea: The kernel is the heart of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":21325,"comment_status":"open","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"_templately_pack_id":"","_templately_imported_at":"","_templately_source":"","_templately_import_session_id":"","footnotes":""},"doc_category":[2733],"doc_tag":[],"class_list":["post-21331","docs","type-docs","status-publish","has-post-thumbnail","hentry","doc_category-servers-without-control-panel"],"year_month":"2026-11","word_count":580,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"admin","author_nicename":"admin","author_url":"https:\/\/www.hyyat.com\/en\/author\/admin\/"},"doc_category_info":[{"term_name":"Servers Without a Control Panel","term_url":"https:\/\/www.hyyat.com\/en\/kb\/servers-without-control-panel\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/21331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/comments?post=21331"}],"version-history":[{"count":0,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/21331\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media\/21325"}],"wp:attachment":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media?parent=21331"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_category?post=21331"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_tag?post=21331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}