Open In App

Ksplice Install Linux Kernel Updates without Reboot

Last Updated : 17 Apr, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The Ksplice software allows changes/patches to be made to the running kernel without the need for any reboot. Important patches are made while the system is still running and there is no need to restart the computer. The software was acquired by Oracle in 2011 and is also known as the Oracle Ksplice.

Why do systems need to reboot in the first place?

We know that if we want to run an application software program, it is first loaded into the RAM. But the operating system itself is software that has to be loaded into the RAM. This is done during the booting process. A reboot is nothing but the booting process done again for many purposes some of which are :

  1. System Updates: Certain files and libraries have to be updated for new features or removing bugs or improving performance and security. To make such changes, the running program has to be stopped since the file or library is currently in RAM and the source code can be modified and the effect be visible only when it is “unlocked” from RAM. The program can be interdependent on other programs and hence, a fresh restart, i.e., reboot ensures that these changes and their effects take place properly.
  2. Hardware Changes: If a hardware component has been changed, then some of the code in the kernel needs to be changed in order to properly work with the newly added or modified hardware which cannot be done while the kernel is still running. Hence, a reboot is necessary.
  3. Troubleshooting: Sometimes the computer becomes unresponsive due to buggy programs causing memory leaks or too many system calls or using too many resources than necessary. A reboot helps in shutting down all the programs and making a fresh restart.

What is Ksplice?

Ksplice is software that helps us in updating our Linux kernel for necessary changes without the need for a reboot(restart). It was the world’s first software to make systems go rebootless. It allows necessary patches to be made to the kernel to improve the security of the system “on the go” without making it reboot(restart). Seeing its potential, the software was soon acquired by Oracle and is also known as the Oracle Ksplice software.

Ksplice instead of comparing the source code rather works at the object code level and compares the compiled code thereby preventing many implementation limitations. For example, a function in C after compilation can lead to an executable function that is different from the source code due to implicit conversion(for ex – char changes to int). Since Ksplice works at the object code level, it is able to see the code changes without needing any information about C language semantics.

It then extracts only the functions that were changed by the patch and then loads them to the kernel.

  1. While updating the kernel using Ksplice, the operations of the kernel are interrupted only for 0.7 milliseconds which is much lesser than the time it takes to reboot.
  2. The operating system, after the Ksplice update, proceeds to work from where it was left.
  3. No network connections or running programs are lost.

It is of immense help to server systems that need to work continuously without stopping for any moment by making them rebootless. 

Why go rebootless?

Almost all the servers around the world operate on Linux. These servers are the backbone of the Internet. They handle a massive amount of data and requests. But the servers also have to be rebooted at least once a month for important kernel and system updates to improve performance or patch security issues or fix critical bugs. These servers operating on various Linux distributions need a reboot for proper maintenance and to stay up to date.

Rebooting causes the server to shut down all its services for some time and the server goes “down”. Due to this network outage : 

  • Many users and clients are unable to fetch any data or use any service provided by the server during downtime.
  • The businesses that were dependent on that server faced huge financial losses. Downtime can cost hundreds of thousands of dollars to the company. 
  • Panic sets in when the server was handling some very important and crucial data like details of passengers boarding a flight.
  • Rebooting may also result in more complications and the loss of current network connections.

Hence there is a need for a mechanism that updates the kernel/system without rebooting. Ksplice helps the system to go rebootless and the advantages of going rebootless are :

  • Avoids downtime and increases the availability of servers
  • Avoids the complications of rebooting and makes it very easy to update the system.

Installing Ksplice

Ksplice is also known as Uptrack. It comes pre-installed in Oracle Linux platforms created after 2017. Ksplice supports only particular Linux distributions like Oracle Linux, CentOS, Ubuntu, and RHEL

For Ubuntu users

Go to the Oracle Ksplice Ubuntu Download page and choose your Ubuntu version and right-click on the Download button and copy the link address.

Open the terminal and go to the Downloads directory or create a new directory and write the following command :

$ wget https://ksplice.oracle.com/uptrack/dist/focal/uptrack.deb
Downloading the .deb package using wget

 

Then install the deb package using apt install.

$ sudo apt install ./package_name
Install the .deb package using apt install

 

If by any chance you encounter problems like unmet dependencies then write the following command :

$ sudo apt --fix-broken install
If any error is shown, follow the steps provided by the apt utility. In this case, 'sudo apt --fix-broken install' solves our problem.

 

After successful installation, we have to agree to the user agreement. Write the command :

$ sudo uptrack-upgrade -n
Subscription agreement of Ksplice

 

A user agreement page will open up in the terminal. Keep hitting the space bar until it reaches the prompt to accept the Ksplice terms of service. Write yes and hit enter.

Entering yes to the Agreement prompt and access key being requested successfully.

 

For Oracle Linux or Red Hat Enterprise Linux users

If your OS is running outside of the Oracle Cloud Infrastructure, then you have to pay subscription fees to try Ksplice or a 30-day free trial option is available.

For registering your Oracle Linux or RHEL, first, go to ULN(Unbreakable Linux Network) and register for a ULN account by clicking on Create New Single Sign-on Account.

ULN Registration page

 

Fill in the relevant details and verify your registered email id. A success page will appear. Click on continue and log in to your Oracle account. Enter the CSI(Customer Support Identifier) number which you got after the purchase of Oracle Cloud Services.

Enter Customer Support Identifier

 

An access key will be fetched successfully. Copy it and write the following commands in the terminal :

$ wget -N https://ksplice.oracle.com/uptrack/install-uptrack
$ sh install-uptrack ACCESS_KEY

Running Ksplice

Original Kernel version

To see the original current kernel version after the booting, write the command : 

$ uname -r

One can also use the command provided by uptrack:

$ sudo uptrack-uname -r
The original kernel version is printed. In our case, it is 5.15.0-60-generic

 

Since we have not yet updated anything, the uptrack-uname is showing the same kernel version as uname.

Viewing and Installing Available Updates

To see the available updates which can be installed to update our kernel, write :

$ sudo uptrack-show --available
Showing all the available updates and their Ksplice IDs in square brackets

 

The updates are represented by the Ksplice ID in square brackets. To only install a particular update instead of all the updates write : 

$ sudo uptrack-install ksplice_ID -y
Installing a particular update by mentioning its Ksplice ID

 

To install all the updates, write :

$ sudo uptrack-upgrade -y
Installing all the updates thereby updating the kernel. The last message shows the version of updated kernel.

 

To see what updates have been installed by Ksplice, write :

$ sudo uptrack-show
Showing all the installed updates. The last message shows the updated kernel version.

 

Verifying whether Kernel is updated

First print the original kernel version that we had when we started our system :

$ uname -r

Now print the updated kernel version :

$ sudo uptrack-uname -r
The kernel version has changed from 5.15.0-60 to 5.15.0-67

 

Clearly, it’s evident that the kernel has been updated without the need for any reboot. The uname -r command will keep showing the older kernel version from the last booting. The uptrack-uname -r shows the current kernel version which is different from the older one.

Conclusion

Thus, one can update the kernel without rebooting with minimal effort and time with the help of Ksplice technology. This has increased the availability and security of servers all around the world with reliable timely updates without the complications and loss of state which is caused by rebooting. Over time, many alternatives have come up that support other Linux distributions as well like KernelCare which supports all popular Linux distributions. Ubuntu Livepatch is another such software that has been specifically made for Ubuntu users to give them a well-rounded user experience.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads