Upgrading Ubuntu: Checking Installed Kernels in the Boot Partition

Abstract: Verify Ubuntu upgrade success by comparing active kernel version with installed packages and boot partition files.

Created: 2026-10-12 by
To verify that an Ubuntu upgrade successfully installed the new kernel, examine the /boot directory for files matching the current version string. Use commands like ls /boot/vmlinuz-* or uname -r to confirm the active kernel matches the latest package available in your repositories. This ensures your system is not booting into an outdated or corrupted kernel image from a previous installation.

Locating Kernel Files in the Boot Partition

The /boot partition contains the essential files required to start the Linux operating system, including the initial RAM filesystem (initrd.img) and the compressed kernel images (vmlinuz). When you perform a standard distribution upgrade using apt, the package manager downloads the new kernel headers and modules but does not always automatically update the bootloader configuration if errors occur. Therefore, manually inspecting this directory is a critical step in validating the integrity of your upgrade process. You can list all kernel images currently present on your disk by running the following command in the terminal:
ls -lh /boot/vmlinuz-*
This command provides a human-readable list of file sizes and modification dates. The most recently modified file is typically the one installed during your last upgrade session. If you see multiple versions listed, it indicates that older kernels are retained on the system, which is normal behavior designed to allow rollback in case the new kernel fails to boot. However, you must ensure that the filename corresponds exactly to the version number reported by your package manager as the installed candidate.

Distinguishing Between Active and Old Kernels

While listing files shows what is physically stored on the disk, it does not tell you which one is currently running. To determine the active kernel, use the uname utility. The command uname -r prints the release string of the currently executing kernel. Compare this output with the filenames found in /boot. If they do not match, your system may be booting into an old kernel while the new one sits idle in the /boot directory, or vice versa, indicating a potential bootloader misconfiguration. For a more detailed view of the kernel parameters and build information, you can check the contents of /proc/version. This virtual file provides the exact compilation timestamp and compiler version used for the running kernel, offering another layer of verification against the packages listed in dpkg.

Verifying Package Installation Status

Checking the filesystem is only half the battle; you must also verify that the Debian package database reflects the correct state. The Linux kernel is distributed as a set of packages, primarily linux-image-generic or linux-image-unsigned-generic depending on your Ubuntu version and security requirements. You can query the status of these packages using dpkg. Run the following command to see the installed version of the generic kernel image:
dpkg -l | grep linux-image
Look for lines starting with ii, which indicates a successfully installed package. The version number in the third column should match the kernel version you expect after the upgrade. If you see rc instead of ii, the package has been removed but its configuration files remain, which might explain why old kernel files persist in /boot even though the package is no longer considered "installed" by the package manager. It is important to note that sometimes the linux-image-generic package acts as a meta-package. It depends on a specific versioned kernel, such as linux-image-5.15.0-xx-generic. Upgrading the meta-package triggers the installation of the newest versioned kernel. If your upgrade failed midway, the meta-package might point to a newer version than what was actually unpacked into /boot. In such cases, apt-get install --reinstall linux-image-generic can force the system to re-evaluate dependencies and pull down any missing components.

Handling Multiple Kernel Versions

Ubuntu retains several old kernel versions by default to ensure system stability. This is managed by the auto-remove feature of APT. If you have performed many upgrades, your /boot partition may contain dozens of kernel files. While this is safe, it consumes disk space. You can clean up unused kernels using apt autoremove, but you must be cautious. Never remove the currently running kernel or the one specified in your bootloader configuration unless you have a verified fallback option. Before cleaning, always identify the running kernel using uname -r. Then, you can safely remove older versions that are no longer needed. For example, if you are running 5.15.0-90 and want to keep only the two most recent minor versions, you can specify the older ones for removal. However, automated cleanup scripts often handle this gracefully if configured correctly via /etc/apt/apt.conf.d/99autoconfigure or similar APT configurations. If you encounter issues where the wrong kernel is being booted despite the correct files being in /boot, you may need to update the GRUB configuration manually. Running update-grub scans the /boot directory and regenerates the /boot/grub/grub.cfg file. This ensures that the bootloader menu lists all available kernels and sets the correct default entry based on your system's preferences. For deeper insights into how these initial ramdisks load modules at startup, which directly affects which kernel features are available upon boot, you might find the guide on Understanding the Loading of Modules by initramfs in Linux helpful. Additionally, if your upgrade process encountered dependency conflicts that prevented the kernel from installing properly, reviewing strategies for Unable to Access Distro During sudo apt-get dist-upgrade on Dual Boot Laptop could resolve underlying package manager corruption issues.

Frequently Asked Questions

Why do I see multiple vmlinuz files in /boot?

Ubuntu keeps old kernel versions to allow you to boot into them if the new one fails. This is a safety feature known as kernel retention. You can safely ignore them as long as the most recent one matches your expected version and is selected in GRUB.

How do I know if my upgrade actually finished?

Check the exit code of your last apt command and run dpkg -l | grep linux-image. If the status is ii and the version matches the one in /boot, the upgrade was successful. If you see errors or mismatched versions, the process likely interrupted.

Can I delete old kernel files manually?

Yes, but it is safer to use apt autoremove or apt purge to remove the associated packages. Manually deleting files from /boot leaves orphaned entries in the package database and GRUB configuration, which can cause confusion during future updates.

What if uname -r shows an old kernel but /boot has a new one?

This usually means the bootloader did not update its configuration file. Run sudo update-grub to rescan /boot and update the GRUB menu. After rebooting, the system should load the newest kernel image found in the directory.

Is it safe to remove all old kernels?

It is generally safe to remove kernels older than the two most recent major versions. However, always keep at least one previous working kernel as a fallback. Removing the currently running kernel will not affect the system until you reboot, at which point it may fail to boot if no other valid kernel is present.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More