Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the different ways to upgrade the Linux kernel for Ubuntu

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail the different ways to upgrade the Linux kernel for Ubuntu. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Part I: kernel upgrades that require restart

The following methods require you to restart the system for the new kernel to take effect. All of the following methods are recommended in a personal system or test system. Once again, please back up important data, configuration files, and other important things in your Ubuntu.

Method 1-upgrade the Linux kernel using dpkg (manually)

This method can help you manually download the latest available Linux kernel from the kernel.ubuntu.com website. This method can be useful if you plan to install the latest version (rather than a stable or official release). Download the Linux kernel version from the link above. At the time of writing this guide, the latest available version is 5.0-rc1, and the latest stable version is v4.20.

Click on the link to the Linux kernel version of your choice to find the part of your corresponding architecture ("Build for XXX"). Then download two files in the following format (where X.Y.Z is the highest version number):

Linux-image-X.Y.Z-generic-*.deb

Linux-modules-X.Y.Z-generic-.deb

In the terminal, change to the directory where the files are located, and then execute this command to install the kernel manually:

$sudo dpkg-- install * .deb

Restart the system, using the new kernel:

$sudo reboot

Check to see if it is what you want:

$uname-r

The above guidelines are for version 4.15, but all the steps for installing the latest version are the same.

Advantage: no need to connect to the Internet (you can download the Linux kernel from any system to use)

Disadvantages: manual update, need to restart the system.

Method 2-upgrade the Linux kernel with apt-get (recommended)

This is the recommended way to upgrade the Linux kernel on Ubuntu-like systems. Unlike the previous method, this method downloads and installs the kernel version from the Ubuntu official repository, rather than from the kernel.ubuntu.com website.

To upgrade the entire system, including the kernel, simply execute:

$sudo apt-get update $sudo apt-get upgrade

If you only want to upgrade the kernel, run:

$sudo apt-get upgrade linux-image-generic

Advantages: simplicity. Recommended method.

Disadvantages: need to be connected to the Internet and need to be restarted.

Upgrading the kernel from the official library is the closest thing to being out of the box, and there will be no problems. If it is a production system, this is the most recommended way to upgrade the Linux kernel.

Both method 1 and method 2 require users to intervene in the process of upgrading the Linux kernel. The following methods (3, 4, 5) are almost fully automatic.

Method 3-upgrade the Linux kernel using Ukuu

Ukuu is a Gtk GUI and command-line tool that downloads the latest Linux mainline kernel from kernel.ubuntu.com and automatically installs it into your Ubuntu desktop and server versions. Ukku not only simplifies the process of manually downloading and installing new kernels, but also helps you safely remove old and unneeded kernels.

Advantages: easy to install and use. Automatically install the mainline kernel.

Disadvantages: need to be connected to the Internet and need to be restarted.

Method 4-upgrade the Linux kernel using UKTools

Like Ukuu, UKTools gets the latest stable kernel from the kernel.ubuntu.com website and automatically installs it into Ubuntu and extended distributions similar to Linux Mint.

Advantages: simple, automatic.

Disadvantages: need to be connected to the Internet and need to be restarted.

Method 5-use the Linux kernel utility to update the Linux kernel

The Linux kernel utility is another program currently used to upgrade the Linux kernel of Ubuntu-like systems. In essence, it is a collection of Bash scripts that compile and optionally upgrade the kernel for Debian and its derivative distributions. It contains three utilities, one for manually compiling and installing the source kernel from the http://www.kernel.org website, another for installing the precompiled kernel from the https://kernel.ubuntu.com website, and a third script for removing the old kernel.

Advantages: simple, automatic.

Disadvantages: need to be connected to the Internet and need to be restarted.

Part II: kernel upgrades without reboot

As I said before, all of the above methods require you to restart the server to enable the new kernel. If it is a personal system or test system, you can do this. But what about the production environment system that cannot be shut down? There is no problem at all, and real-time patches (livepatching) come in handy.

Real-time patches (or hot patches) allow you to install Linux updates or patches without rebooting to keep your server at the latest security level. This is very valuable for servers such as web hosts and game servers that need to be online without interruption. In fact, in any case, the server should be kept running uninterrupted. Since Linux vendors only maintain patches for the purpose of fixing security vulnerabilities, this approach is perfect if security is your biggest concern.

The following two methods do not require a restart and are useful for Linux kernel updates for production environments and Ubuntu servers that perform critical tasks.

Method 6-use Canonical real-time patch service to update the Linux kernel

The Canonical real-time patch service automatically applies kernel updates, patches, and security patches without the need to restart the Ubuntu system. It can reduce the downtime of the Ubuntu system and ensure the safety of the system. The Canonical real-time patch service can be set up during or after installation. If you are using the Ubuntu desktop version, the software updater will automatically check for kernel patches and notify you. In console-based systems, you need to run apt-get update commands regularly to upgrade. Since it requires you to run the apt-get upgrade command manually to install kernel security patches, it is semi-automatic.

Real-time patches are free for three or less systems, and if there are more than three, you need to upgrade to an enterprise support suite called Ubuntu Advantage. This suite includes Kernel real-time patches and the following services:

Extended Security maintenance-important Security updates after the Ubuntu Lifecycle

Landscape-A system management tool for large-scale use of Ubuntu

Knowledge Base-personal articles and tutorials written by Ubuntu experts

Phone and website support

(1) Price

Ubuntu Advantage includes three kinds of payment plans, namely, basic plan, standard plan and advanced plan. The most basic plan (basic plan) starts at US $225 / year per physical node and US $75 / year per VPS. There seems to be no monthly subscription for Ubuntu server and desktop versions. You can browse all the details of the plan here.

Advantages: simplicity. Semi-automated. No reboot is required. Three free systems are supported.

Cons: more than 4 hosts are very expensive. No patch rollback.

(2) enable Canonical real-time patch

If you want to set up a real-time patch service after installation, follow these steps:

$sudo snap install canonical-livepatch $sudo canonical-livepatch enable your-key

Method 7-upgrade the Linux kernel using KernelCare

KernelCare is the latest real-time patch. It is a product launched by CloudLinux. KernelCare can run in Ubuntu and other Linux distributions. It checks for patch releases every four hours and installs them without confirmation. If there is a problem after the update, you can roll back the patch.

(1) Price

Cost: $4 / month, $45 / year per server.

Compared to Ubuntu real-time patches, KernelCare looks very cheap and affordable. The good news is that you can also subscribe by month. Another feature that the former does not have is support for other Linux distributions, such as Red Hat, CentOS, Debian, Oracle Linux, Amazon Linux and virtualization platforms such as OpenVZ and Proxmox.

You can learn all the features and profiles of KernelCare here, as well as the details of all the payment plans.

Advantages: simplicity. Fully automated. A wider range of operating systems. Patch rollback. No reboot is required. Provide free licenses to non-profit organizations. The price is low.

Cons: not free (except for a 30-day probation period).

Enable the KernelCare service

Get a 30-day free trial key at https://cloudlinux.com/kernelcare-free-trial5.

Execute the following command to open KernelCare and register the key.

$sudo wget-qq-O-https://repo.cloudlinux.com/kernelcare/kernelcare_install.sh | bash $sudo / usr/bin/kcarectl-- register KEY

If you are looking for an affordable and reliable business service to keep the Linux kernel updated on Linux servers, then KernelCare is a good choice.

This is the end of this article on "what are the different ways to upgrade the Linux kernel for Ubuntu". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report