🐧
Linux

Updating the Linux Kernel on Ubuntu and Debian

πŸ“… 19 October 2026 ✏️ 19 October 2026 ⏱ 4 min leestijd

Learn how to safely update the Linux kernel on Ubuntu and Debian: via apt, livepatch without reboot, or reboot. Step-by-step guide.

The Linux kernel forms the core of your server and often contains security patches. On Ubuntu and Debian, the kernel is usually updated automatically along with regular package updates via apt, but a reboot is required to activate a new kernel. With livepatch techniques, you can fix critical vulnerabilities without restarting. In this article, you’ll learn how to safely and systematically update your kernel, with or without downtime.

Why update the kernel

The kernel manages the communication between hardware and software. Security vulnerabilities in the kernel can lead to privilege escalation, where an attacker with limited rights gains full control over the server. Distributions such as Ubuntu and Debian regularly release kernel updates via their package management, similar to updates for other software. An outdated kernel is one of the most common causes of vulnerable servers, especially on long-running systems that are rarely restarted.

apt updateapt upgradereboot / livepatch

Updating the kernel via apt

This process works identically on both Ubuntu and Debian, since both distributions use apt as their package manager.

1

Refresh package lists

Run sudo apt update to synchronize the local package list with the repositories.

2

Upgrade the system

Use sudo apt upgrade to install all packages, including a new kernel version if available.

3

Check whether a reboot is needed

Check with ls /var/run/reboot-required whether the file exists. If it does, the server is still running on the old kernel.

4

Restart the server

Run sudo reboot at a quiet moment. After restarting, check the active version with uname -r.

πŸ’‘ Tip: Always schedule a reboot outside peak hours and inform users beforehand if the server hosts email or websites.

Updating the kernel without a reboot

A reboot is not always desirable, for example on production servers with strict uptime requirements. For these kinds of situations, livepatch solutions exist.

On Ubuntu, you can use Canonical Livepatch: sudo snap install canonical-livepatch, followed by sudo canonical-livepatch enable <token>. This applies critical security patches directly to the running kernel, without a restart. However, this does not cover all updates; major kernel versions will still eventually require a reboot.

On Debian, kpatch is a similar alternative, although support is more limited than Ubuntu’s Livepatch service. For most regular updates, a scheduled reboot remains the most reliable method to be sure that the new kernel is actually active.

Managing multiple servers or unsure about the right approach? In the Plesk panel with webhosting from Tandata, you can easily see system notifications about available updates, and plan maintenance better using the built-in tools.

Cleaning up and checking old kernels

After several updates, old kernel versions often remain on disk, taking up space. With sudo apt autoremove, you remove kernels that are no longer needed, except for the active one and usually one backup version. Check which kernels are installed with dpkg --list | grep linux-image.

After each update, verify that important services have restarted correctly, such as the web server, database, and mail services. A good habit is to keep a maintenance schedule, so updates don’t get neglected. If in doubt, consult the knowledge base for more background articles on server management.

Frequently asked questions

Do I need to restart the server after every apt upgrade?

No, only if a new kernel has actually been installed. Check this with the file /var/run/reboot-required.

Is livepatch free to use?

Canonical Livepatch is available for a limited number of machines without a subscription. For larger environments, an Ubuntu Pro subscription is generally required.

How do I know which kernel version is active?

Use the command uname -r. This shows the version that is currently actually running, not the last one installed.

Can a kernel update cause my website or email to go down?

A reboot causes brief downtime. Therefore, schedule updates outside of busy hours and test after the reboot whether websites and email, for example via business email, function normally again.

Does this procedure also work on a freshly migrated domain?

Yes, the procedure is independent of which domains or websites are running on the server. When migrating, also read the information about switching to Tandata for a smooth transition.

Conclusion

Updating the Linux kernel on Ubuntu and Debian is usually done via apt update and apt upgrade, followed by a reboot to activate the new kernel. If you want to avoid downtime, livepatch is a good addition for critical patches, though a periodic reboot is still needed. Keep track of old kernels and regularly check for maintenance notifications to keep your server secure and up to date.

View webhosting β†’

Was dit artikel nuttig?