Linux online course

Linux Kernel: Purpose, Architecture, and How to Check the Kernel Version

Learn what the Linux kernel does, how it connects applications to hardware, how kernel architecture works, and how to check the running kernel version.

The Linux kernel is the central, privileged component of a Linux-based operating system. It manages hardware, provides essential services to programs, and controls how system resources are shared.

This article explains the kernel's role, its architecture, its relationship with Linux distributions, and practical commands for identifying the kernel currently running on your system.

What Is a Kernel?

A kernel is the privileged core of an operating system. It mediates between application programs and physical hardware such as processors, memory, disks, network adapters, displays, keyboards, and USB devices.

Applications normally do not access hardware directly. Instead, a program makes a request through a system call or another operating-system interface. The kernel checks the request, performs the protected operation when permitted, and returns a result.

For example, a Wi-Fi application does not usually control radio hardware by writing directly to device registers. It asks the kernel's networking subsystem to send data. The networking code and an appropriate device driver then coordinate access to the Wi-Fi adapter.

User Space and Kernel Space

User space is the less-privileged environment where ordinary applications and many system services run. A faulty application in user space should not be able to freely overwrite another program's memory or control every device.

Kernel space is the protected execution environment used by the kernel and kernel code. In this environment, the CPU permits operations that are restricted in user space, such as configuring hardware or managing page tables.

A system call, interrupt, or hardware event can cross the boundary between user space and kernel space. The CPU switches to a privileged or supervisor mode so that the kernel can handle the request safely.

What the Linux Kernel Is

Linux is a free and open-source kernel. It is used in distributions and systems for desktops, servers, cloud platforms, embedded devices, appliances, mobile systems, and many other purposes.

The kernel alone is not usually a complete, installable Linux operating system. A complete Linux distribution typically combines the Linux kernel with user-space programs, shared libraries, shells, initialization and boot tools, package management, configuration utilities, and desktop or server software.

For example, two distributions may use related Linux kernel releases but provide different package managers, default configurations, desktop environments, update policies, and support periods. The distribution supplies the surrounding operating-system environment and packages the kernel for its users.

Core Responsibilities of the Linux Kernel

Process and Task Scheduling

The kernel schedules runnable tasks: processes and threads that are ready to use a CPU. It decides when each task runs, for how long, and on which processor in a multi-core system. Scheduling helps the system remain responsive while allowing many programs to run concurrently.

Memory Management

The kernel allocates memory to processes and maintains virtual memory, which gives each process an organized address space. It protects process address spaces from one another, manages physical memory, and can use storage as backing for memory through mechanisms such as paging and swap.

Devices and Drivers

A device driver is kernel code that enables communication with a particular class or model of hardware. Drivers help the kernel operate storage controllers, network adapters, displays, input devices, USB hardware, sound devices, and other peripherals.

File-System Support

The kernel provides the interfaces used by programs to open, read, write, and organize files. It also supports file-system implementations and connects them to mounted storage. Applications can often use the same file operations without needing to know the physical details of a disk or file system.

Networking

The kernel implements core networking functions and protocol support. It manages network interfaces, routes packets, applies filtering rules, and provides interfaces used by applications for connections and data transfer.

Security and Access Control

The kernel enforces foundational permissions and access checks. It also supports capabilities, isolation mechanisms, auditing interfaces, and security frameworks. These controls help determine which users, processes, and services may access resources.

System Calls and Interprocess Communication

System calls provide controlled entry points into kernel services. A program can use them to create processes, allocate memory, access files, communicate over a network, or interact with devices.

Interprocess communication allows processes to exchange data or coordinate safely. Examples include pipes, signals, shared memory, sockets, and other kernel-managed mechanisms.

Linux Kernel Architecture and Execution Modes

Linux is generally described as a monolithic kernel with a modular design. In a monolithic architecture, major services such as scheduling, memory management, file systems, networking, and many drivers run in kernel space and can communicate directly with one another.

Monolithic does not mean that every possible driver is permanently built into one unchangeable binary. Kernel modules are separately built pieces of kernel functionality that can often be loaded or unloaded while the system is running. A removable USB device, for example, may cause a relevant driver module to be loaded when the device is connected.

Architecture typeWhere major services runGeneral characteristicsLinux relationship
MonolithicMost core services run in kernel spaceDirect communication between kernel services can provide performance, but a fault in kernel code can affect the whole systemLinux uses this model, with loadable modules adding flexibility
MicrokernelA small core runs in kernel space; more services run as user-space processesSmaller privileged core and stronger service separation, but communication between components may add complexity or overheadLinux is not a pure microkernel
HybridCombines ideas from monolithic and microkernel designsSome services remain closely integrated while other components are separated or structured like user-space servicesLinux is commonly classified as monolithic rather than hybrid

No architecture is universally superior. Design choices involve trade-offs among performance, isolation, complexity, hardware support, maintainability, and project goals.

Linux Kernel Source, Licensing, and Development

Linux kernel source code is publicly available under GPL-2.0-only, the GNU General Public License version 2. Under the license conditions, recipients can study the source, modify it, and redistribute the source or derived versions while meeting the applicable license requirements.

Linus Torvalds created Linux in 1991. Development is now performed by a worldwide community that includes individual contributors, hardware and software companies, distribution teams, subsystem experts, testers, and maintainers.

From Upstream Releases to Distribution Kernels

  • The upstream kernel is released by the main Linux kernel development project before distribution-specific packaging and changes.
  • Subsystem maintainers oversee areas such as networking, storage, file systems, architecture support, and drivers.
  • Maintainers and contributors review changes and submit work through the kernel development process.
  • Stable releases receive selected fixes after an upstream release, especially bug and security fixes.
  • Distributions select a kernel version, configure it, package it, apply supported patches, and publish it through their package repositories.

As a result, a distribution's kernel package may contain the upstream kernel plus backported fixes, configuration choices, hardware support, security changes, and a distribution-specific version suffix.

Kernel Versions and Distribution-Specific Version Strings

An upstream release is commonly described with a format such as major.minor.patch. For example, in 6.8.12, 6 is the major component, 8 is the minor component, and 12 identifies a patch-level release.

Distribution version strings often append package, build, flavor, cloud, real-time, debug, or vendor identifiers. An output such as 6.8.0-31-generic contains an upstream-style numeric portion and a distribution or package suffix. The complete string is the active kernel's kernel release string.

Always distinguish the running kernel from installed kernel packages. A system may have several kernel images installed so that the bootloader can offer alternatives, but only one kernel is normally loaded and controlling the current system.

Installing a newer kernel package does not normally switch the active kernel immediately. A reboot is generally required to load the new kernel. Until then, uname -r continues to report the older kernel that is already in memory.

How to Check the Running Linux Kernel Version

Use uname -r for the Concise Release

The most portable quick check is:

uname -r

Example output:

6.8.0-31-generic

This command displays the release string of the currently running kernel, not simply the newest kernel package installed on disk.

Use uname -a for a Broader Summary

uname -a

This displays a broader system summary, commonly including the kernel name, kernel release, build or version information, system hostname, and machine architecture. Use uname -r when a support request asks specifically for the kernel release; use uname -a when more context is useful.

Read /proc/version

/proc is a virtual file system that exposes process and kernel information. To read kernel version and build details, use:

cat /proc/version

The result commonly includes a Linux version identifier, build information, and compiler or build metadata when available. It is useful for additional context, but its output is less concise than uname -r.

Use hostnamectl Where Available

hostnamectl

On systems using systemd, hostnamectl can display operating-system and kernel information along with host details. It is not available on every Linux installation, particularly some minimal systems, containers, or systems that do not use systemd.

Inspect the Conventional Boot-Kernel Symlink

readlink -f /boot/vmlinuz

Some distributions provide /boot/vmlinuz as a symlink to a kernel image. The command resolves that link and can help identify the kernel image associated with the conventional boot path. Boot file names, symlinks, and boot methods vary, so this is not as portable as uname -r.

Command or sourceWhat it showsBest use caseAvailability or caveats
uname -rRelease string of the active kernelQuick, portable version checkUsually available on Linux and reports the running kernel
uname -aKernel release plus hostname, architecture, and other identifiersCollecting broader troubleshooting detailsIncludes more than the kernel version
cat /proc/versionKernel version and build metadataInspecting compiler and build informationUses the virtual /proc file system
hostnamectlOperating-system and kernel informationViewing host details on systemd-based systemsNot available on every installation
readlink -f /boot/vmlinuzResolved target of a conventional boot-kernel symlinkInspecting a boot image pathDistribution- and boot-layout-dependent

Kernel-Related Locations in the Linux File Hierarchy

LocationTypical purposeNotes
/bootKernel images, initial RAM filesystems, bootloader files, and related boot artifactsNames, mount arrangements, and available symlinks differ by distribution and boot method
/lib/modules/$(uname -r) or /usr/lib/modules/$(uname -r)Modules and metadata associated with a particular kernel releaseSome distributions use a merged-/usr layout or another location
/proc/versionVirtual file containing kernel version and build informationIt is generated by the running kernel rather than stored as an ordinary disk file
/sysVirtual interface exposing devices, drivers, and other kernel-managed objectsUseful for inspecting hardware relationships, but exact contents depend on the running system

For example, to inspect modules for the active release on systems using the conventional path, run:

ls /lib/modules/$(uname -r)

If that path does not exist, check whether the system uses /usr/lib/modules or another distribution-specific layout. Package commands and bootloader tools also differ across distributions.

Why Kernel Version Information Matters

  • Hardware support: newer releases may add or improve drivers for devices such as Wi-Fi adapters, graphics hardware, storage controllers, and processors.
  • Security: updates can fix vulnerabilities in the kernel and its drivers.
  • Bug fixes: stable releases and distribution updates may correct crashes, hangs, and incorrect behavior.
  • Performance: scheduling, storage, networking, power management, and memory-management changes can affect performance.
  • File-system features: kernel support determines which file-system capabilities and fixes are available.
  • Compatibility: applications, drivers, virtualization platforms, and hardware may require particular kernel features or interfaces.

Support requests often ask for the running kernel version because it helps identify the exact code handling hardware and system operations. Include the full output of uname -r, including unfamiliar suffixes, rather than reporting only the numeric prefix.

Troubleshooting Kernel Version Checks

An Update Was Installed but uname -r Shows an Older Kernel

  • The new kernel package may be installed, but the system has not been rebooted.
  • The bootloader may have selected an older kernel.
  • The new kernel image may not have installed successfully or may not be bootable.

First compare uname -r with the installed kernel packages using the package manager for the distribution. If the newer package is present, review boot entries and reboot into the intended kernel when it is safe to do so. Keep a known-working older kernel until the new one has been verified.

A Command or Expected Path Does Not Exist

Use uname -r as the first choice. If a more detailed result is needed, try cat /proc/version. A missing hostnamectl may simply mean the system does not use systemd. Missing boot paths may result from a different distribution layout, a merged-/usr system, a container, a minimal image, or a different boot method.

The Version Has an Unfamiliar Suffix

A suffix can identify distribution packaging, a kernel flavor, a cloud or real-time build, debugging support, or a vendor modification. Treat the complete uname -r output as the active release identifier. The numeric prefix often resembles the upstream version, while the suffix provides important distribution-specific context.

A Container Reports an Unexpected Kernel

Containers normally share the host kernel rather than booting a separate kernel. Therefore, uname inside a container usually reports the host's running kernel. Distinguish the container image's user-space distribution and release from the host kernel release.

Summary

  • The kernel is the privileged core that mediates between applications and hardware.
  • Linux is an open-source kernel; a Linux distribution adds user-space programs, libraries, tools, packages, and configuration.
  • The Linux kernel schedules tasks, manages memory, controls devices, supports file systems and networking, enforces security, and provides system calls.
  • Linux is a monolithic kernel with a modular design, so loadable modules can add functionality at runtime.
  • uname -r is the concise way to identify the running kernel release.
  • Installed kernel packages and the running kernel are not necessarily the same; a reboot is generally needed to begin using a newly installed kernel.
  • Kernel version information helps diagnose hardware support, security, compatibility, performance, and bug-fix issues.