How to update the kernel on Ubuntu and confirm it's running

Updated November 15, 2026By HostCrust9 min read

Run sudo apt update and sudo apt upgrade, then reboot. Ubuntu ships kernel fixes as normal packages, and the new kernel only runs after the reboot.

After the reboot, check that uname -r shows the newest installed kernel. Stay on Ubuntu's own kernels: linux-generic, or the HWE kernel linux-generic-hwe-24.04 if you need newer hardware support. Mainline and PPA kernels get no security support.

How do kernel updates reach an Ubuntu server?

On Ubuntu, the kernel is a package like any other. Updates come from the Ubuntu archive, and kernel security fixes are published in the security pocket (noble-security on 24.04). There are three parts to know:

  • A versioned kernel package, such as linux-image-6.8.0-149-generic. Each new kernel ABI gets a new package name, so it installs next to the old kernel instead of replacing it.
  • A metapackage, such as linux-generic. It always depends on the newest versioned kernel, which is how the next kernel gets pulled in.
  • A reboot. The running kernel doesn't change until the machine boots the new one.

Find out which metapackage your server follows, and whether a newer kernel is waiting:

$ apt-mark showmanual | grep '^linux-'
linux-generic

$ apt-cache policy linux-generic
linux-generic:
  Installed: 6.8.0-149.149
  Candidate: 6.8.0-149.149
  Version table:
 *** 6.8.0-149.149 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
        100 /var/lib/dpkg/status
     6.8.0-31.31 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages

Here “Installed” equals “Candidate”, so this server already has the newest kernel Ubuntu has published. If the candidate is higher, an update is waiting. Cloud images usually follow a cloud metapackage instead, such as linux-aws or linux-azure, and the same steps apply.

Update the kernel with apt

sudo apt update
apt list --upgradable 2>/dev/null | grep '^linux-'   # kernel packages waiting, if any
sudo apt upgrade                                     # installs the new kernel next to the old one
cat /var/run/reboot-required.pkgs                    # the packages that asked for a reboot

A few details matter on a server:

  • Use apt, not apt-get upgrade. A new kernel is a new package. apt upgrade installs new packages when an upgrade needs them. apt-get upgrade never does, so it leaves linux-generic behind with a “kept back” message. Our guide to packages kept back explains that message, and apt upgrade vs full-upgrade covers when to use which command.
  • Unattended-upgrades already does this part. On Ubuntu Server it installs kernel security updates on its own. It doesn't reboot, so the new kernel is often installed already and only the reboot is missing. See our unattended-upgrades guide.
  • Check free space on /boot with df -h /boot if it's a separate partition. Every kernel adds an image and an initramfs there, and old kernels pile up until you remove them (see below).

GA or HWE kernel: which one should a server run?

Each Ubuntu LTS release offers two kernel tracks. The GA (general availability) kernel is the one the release shipped with. The HWE (hardware enablement) kernel brings a newer kernel from later Ubuntu releases to the same LTS.

Ubuntu 24.04GA kernelHWE kernel
Metapackagelinux-genericlinux-generic-hwe-24.04
Kernel version6.8, for the whole life of 24.04Moved 6.11 → 6.14 → 6.17 → 7.0; stays on 7.0 from 24.04.5 (July 2026)
Standard security supportUntil May 20297.0 until May 2029. Each earlier HWE kernel was supported only until the next one arrived
Default onServer installsDesktop installs
Livepatch window13 months per kernel13 months for 7.0 (9 months for earlier HWE kernels)

For most servers, stay on the GA kernel. It changes least, and it has the same support end date. Switch to HWE when you need it, for example for new hardware that the 6.8 kernel doesn't support well. One exception: most Ubuntu cloud images use a rolling cloud kernel by default, which follows the HWE model. Check before you assume you're on GA.

This server runs the GA kernel:

$ hwe-support-status --verbose
You are not running a system with a Hardware Enablement Stack. Your system is supported until May 2029.

To move to HWE, install its metapackage. Simulate it first to see what you'd get:

$ apt-get -s install --install-recommends linux-generic-hwe-24.04 | grep -E '^Inst linux-image|newly installed'
0 upgraded, 14 newly installed, 0 to remove and 2 not upgraded.
Inst linux-image-7.0.0-43-generic (7.0.0-43.43~24.04.1 Ubuntu:24.04/noble-updates, Ubuntu:24.04/noble-security [amd64])
Inst linux-image-generic-hwe-24.04 (7.0.0-43.43~24.04.1 Ubuntu:24.04/noble-updates, Ubuntu:24.04/noble-security [amd64])

Then run the same command with sudo apt install instead of apt-get -s install, and reboot. The new 7.0 kernel installs next to 6.8, and GRUB boots the highest version by default.

Going back to GA isn't one command. The install removes nothing (0 to remove above), so linux-generic and the 6.8 kernel stay installed. But GRUB keeps booting 7.0 by default while a 7.0 kernel is installed, and the HWE metapackage keeps installing each new 7.0 kernel update. Going back means removing the HWE metapackages and the 7.0 kernel packages yourself, and Canonical's HWE page documents only the move to HWE. Try it on one server before the rest.

Reboot, then confirm the new kernel is running

Before you reboot a remote server, make sure you can reach its console (the provider's web console, serial console or IPMI). If the new kernel doesn't boot, the GRUB menu and any boot errors appear there, not over SSH. Our reboot guide lists the other checks under how do I avoid locking myself out?

Write down the running kernel, reboot, and check again when the server is back:

uname -r                       # before: the old kernel
sudo reboot
# ...reconnect after a minute or two...
uname -r                       # after: should be the newest installed kernel
linux-version list | linux-version sort | tail -n 1

The last two lines must print the same version. If uname -r still shows the old kernel, the server either didn't reboot or booted the old kernel. Check the boot history:

$ last -x -w reboot
reboot   system boot  6.8.0-149-generic Sat Nov 14 12:33   still running
reboot   system boot  6.8.0-31-generic Sat Nov 14 12:20 - 12:33  (00:12)

That's the boot history of our Ubuntu 24.04 server from when it was set up (we didn't reboot it for this guide): one boot on the original 24.04 kernel (6.8.0-31), then a reboot into 6.8.0-149 after its first kernel update. Our guide to checking the kernel version has more ways to compare running and installed kernels. The Linux reboot command guide covers scheduling the reboot and proving the server came back.

How do I remove old kernels safely?

Old kernels stay on disk after an update. apt marks them as no longer needed, and apt autoremove deletes them, with one built-in safeguard: it always keeps the kernel that is running plus the newest other kernel. You can watch it decide in a simulation:

$ apt-get -s -o Debug::pkgAutoRemove=1 autoremove 2>&1 | grep -E '^(Amount|Keeping)'
Amount of kernels to keep 2
Keeping booted kernel 6.8.0-149.149
Keeping previous kernel 6.8.0-31.31

So the safe routine is:

  1. Reboot into the new kernel first, and confirm it with uname -r.
  2. Preview the removal: apt-get -s autoremove.
  3. Remove: sudo apt autoremove --purge.

The kept previous kernel is your way back if the new one misbehaves. On Ubuntu 24.04 (apt 2.8), the number comes from APT::NeverAutoRemove::KernelCount: default 2, and apt never goes below 2. Don't delete kernel packages by hand with dpkg, and never remove the package of the kernel you are running.

Livepatch: kernel fixes without a reboot

Canonical Livepatch applies fixes to the running kernel in memory. It is part of Ubuntu Pro, which is free for personal use on up to five physical machines. On an LTS release, Livepatch turns on when you attach the machine to Pro:

sudo pro attach <your-token>
sudo pro enable livepatch          # only needed if it was turned off
sudo canonical-livepatch status

Our Ubuntu 24.04 server could use it but isn't attached:

$ pro status 2>/dev/null | grep -E '^livepatch|not attached'
livepatch        yes        Canonical Livepatch service
This machine is not attached to an Ubuntu Pro subscription.

Know what it does and doesn't cover:

  • It covers high and critical kernel vulnerabilities, on the kernels Canonical lists as supported (including the 24.04 GA and HWE kernels).
  • It doesn't cover low and medium kernel fixes, or anything outside the kernel. OpenSSL, glibc and systemd updates still need their services restarted or a reboot.
  • It doesn't change the kernel version. uname -r shows the same release after a live patch. Use canonical-livepatch status to see what's applied.
  • It doesn't replace reboots. Each kernel gets live patches for 9 to 13 months after its release. To keep receiving them, you must upgrade the kernel and reboot within that window.

Treat Livepatch as a way to stretch the time between planned reboots, not to skip them.

Why not install a mainline or PPA kernel on a server?

Search results often suggest a newer kernel from Ubuntu's mainline builds, a “mainline installer” tool or a PPA. Don't do that on a production server. Canonical's own kernel documentation is blunt: “Mainline build kernels are not supported and never receive security updates.”

A kernel that apt doesn't update is a kernel that stays vulnerable. Mainline builds are .deb files you download by hand, so apt never updates them. PPA kernels depend on whoever runs the PPA. Neither one is covered by Ubuntu's security updates or Livepatch. If you need a newer kernel, use the HWE kernel, which Canonical supports with security updates and Livepatch.

Debian, RHEL, AlmaLinux and Rocky Linux

Debian

Debian works like Ubuntu. The metapackage on 64-bit PCs is linux-image-amd64. It pulls in a 6.1 kernel on Debian 12 and a 6.12 kernel on Debian 13, and kernel security fixes arrive through the security archive. On our Debian 12 test server:

$ apt-cache policy linux-image-amd64 | head -n 6
linux-image-amd64:
  Installed: 6.1.190-1
  Candidate: 6.1.190-1
  Version table:
 *** 6.1.190-1 500
        500 http://security.debian.org/debian-security bookworm-security/main amd64 Packages

Run sudo apt update and sudo apt upgrade, then reboot. Debian 12's older apt (2.6) protects kernels from autoremove with the same result: the running kernel plus the newest other one.

$ apt-get -s -o Debug::pkgAutoRemove=1 autoremove 2>&1 | grep -E '^(Amount|Keeping)'
Keeping booted kernel 6.1.190-1
Keeping latest kernel 6.1.190-1
Keeping previous kernel 6.1.128-1

The kernel hook that writes /var/run/reboot-required ships with unattended-upgrades on Debian, so install that package if you rely on the flag.

RHEL, AlmaLinux and Rocky Linux

The RHEL family splits the kernel into several packages. Rocky Linux's own documentation updates it with dnf update kernel, which works when the kernel package is installed. The AlmaLinux 9.6 image on our test server has only kernel-core, and there that command does nothing:

$ sudo dnf update kernel
Package kernel available, but not installed.
No match for argument: kernel
Error: No packages marked for upgrade.

Check with rpm -q kernel kernel-core, then update the package you have, or run a full sudo dnf upgrade. A preview with --assumeno changes nothing:

$ sudo dnf update kernel-core --assumeno
Dependencies resolved.
================================================================================
 Package                 Arch       Version                    Repository  Size
================================================================================
Installing:
 kernel-core             x86_64     5.14.0-687.66.2.el9_8      baseos      17 M
 kernel-modules-core     x86_64     5.14.0-687.66.2.el9_8      baseos      31 M
Transaction Summary
================================================================================
Install  2 Packages
Total size: 48 M
Installed size: 97 M
Operation aborted.

It says “Installing”, not “Upgrading”: the new kernel goes in next to the running one. The rest of the routine, with console access ready before the reboot as on Ubuntu:

sudo dnf update kernel-core        # or "kernel", whichever rpm -q found ("update" is an alias of "upgrade")
sudo grubby --default-kernel       # the kernel that will boot next
sudo reboot
uname -r                           # after the reboot: should match grubby --default-kernel

We watched this on the same server after a full dnf upgrade took it from AlmaLinux 9.6 to 9.8. Before the reboot, the new kernel was the default but not running:

$ uname -r
5.14.0-570.12.1.el9_6.x86_64
$ sudo grubby --default-kernel
/boot/vmlinuz-5.14.0-687.66.2.el9_8.x86_64

After the reboot, the two matched:

$ uname -r
5.14.0-687.66.2.el9_8.x86_64
$ sudo grubby --default-kernel
/boot/vmlinuz-5.14.0-687.66.2.el9_8.x86_64

Don't rely on dnf needs-restarting -r alone for kernels. On this server it asked for a reboot because glibc and systemd had changed, but it didn't list the new kernel, because the EL9 version checks for a package named kernel. Our guide to checking the kernel version shows its output.

dnf keeps up to three kernels by default (installonly_limit=3 in /etc/dnf/dnf.conf, as on our test server). It removes older ones automatically, but never the running kernel, so there's no separate cleanup step. grubby --default-kernel should name the kernel you just installed. If it names an older one, check the boot configuration before you reboot.

How we checked this: On 14 Nov 2026 (UTC): an Ubuntu 24.04.5 LTS production server (kernel 6.8.0-149-generic, apt 2.8.4) with read-only commands and apt-get -s simulations only; a Debian 12.15 test server (apt 2.6.2) with read-only commands and simulations; and an AlmaLinux test server, where we previewed dnf commands with --assumeno, then checked the kernels before and after its upgrade from 9.6 to 9.8 and the reboot. We didn't install a kernel on or reboot the Ubuntu server; its boot history below is from when it was set up. GA, HWE and Livepatch behavior comes from Canonical's documentation. Anything we didn't run ourselves comes from the official documentation listed under Sources.

Check which CVEs are really open on your server

HostCrust Patch Proof compares every installed package with your distribution's own security data. It counts fixes your distro backported and checks the kernel that is actually running, not just the one on disk. Read-only, no root, free.

Run the free check About Patch Proof

Reboots with an approval step

By default, HostCrust holds a reboot until an approver signs off (your org's policy decides), then checks that the server reports a new boot ID. Every step is kept in a receipt you can export. Free for up to 3 servers.

See how HostCrust works

FAQ

Does apt upgrade install a new kernel?

Yes, with apt. Each new kernel is a new package, and apt upgrade installs new packages when an upgrade needs them. apt-get upgrade doesn't, so it keeps the kernel metapackages back. Use sudo apt upgrade, sudo apt full-upgrade or sudo apt-get dist-upgrade.

Do I have to reboot after a kernel update?

Yes. The new kernel is installed next to the old one and only runs after a reboot. Until then the server is still exposed to the bugs the update fixed. Livepatch is the exception for high and critical kernel vulnerabilities, but it still needs a real kernel upgrade and reboot within 9 to 13 months.

Which kernel does Ubuntu 26.04 use?

Ubuntu 26.04 LTS ships a kernel based on Linux 7.0, according to Canonical's kernel lifecycle table. Since July 2026 (the 24.04.5 point release), the same 7.0 kernel is also the HWE kernel for Ubuntu 24.04.

Is Ubuntu 24.04 on the latest kernel version?

No, and that's by design. Ubuntu 24.04's default (GA) kernel is based on 6.8 and stays on 6.8 until May 2029. The HWE kernel is 7.0. kernel.org's latest stable series in November 2026 is 7.3. Canonical backports security fixes into its own kernels, so a patched 6.8 kernel isn't missing the fixes that matter.

Will kernel 6.18 be LTS?

It already is. kernel.org lists 6.18 as a longterm kernel, with a projected end of life in December 2028 (as of November 2026). That's the upstream schedule, and Ubuntu's kernels don't follow it: Ubuntu 24.04 stays on 6.8 (GA) or 7.0 (HWE), and Canonical backports fixes into those.

How do I go back to the previous kernel?

Reboot and pick it under “Advanced options for Ubuntu” in the GRUB menu. You need console access for that, because the menu appears before the network and SSH are up. apt keeps the previous kernel installed, so there is one to go back to. On many servers the menu is hidden; check GRUB_TIMEOUT_STYLE and GRUB_TIMEOUT in /etc/default/grub before a risky update.

Sources

  1. Ubuntu kernel lifecycle and enablement stack (GA and HWE kernels, support dates)
  2. Ubuntu kernel documentation: HWE kernels
  3. kernel.org: active kernel releases and longterm kernels (6.18 projected EOL)
  4. Ubuntu public cloud documentation: kernels on the cloud
  5. Ubuntu kernel documentation: testing with a mainline kernel (support warning)
  6. Canonical Livepatch documentation
  7. Livepatch: kernels covered and their support windows
  8. Ubuntu Pro client: how to enable Livepatch
  9. apt(8) manual page, Ubuntu 24.04 (upgrade and full-upgrade)
  10. apt 2.8.4 source: which kernels autoremove protects
  11. apt 2.6.2 source (Debian 12): which kernels autoremove protects
  12. Debian package linux-image-amd64 (trixie)
  13. Rocky Linux documentation: the Linux kernel lab (dnf update kernel, grubby)
  14. DNF configuration reference: installonly_limit
  15. DNF command reference: update is a deprecated alias of upgrade