You can check your Linux kernel version using the terminal command uname -r. This displays the version number of the currently running kernel. Alternatively, use cat /proc/version to see the full build details including the compiler and configuration used. No additional software or installation is required.

What You'll Need

  • A computer running a Linux-based operating system (such as Ubuntu, Debian, CentOS, Fedora, or Arch Linux).
  • A user account with standard privileges (root access is not required for these commands).
  • A working command line interface (CLI) terminal.

Step-by-Step

  1. Open the Terminal: Locate the terminal application on your system. This is often found in the application menu under "System Tools" or "Accessories". On many desktop environments like GNOME or KDE, you can also press the keyboard shortcut Ctrl + Alt + T to open a new session.
  2. Verify the Command: Ensure you are at the command prompt (usually indicated by a dollar sign $ or a hash symbol #). Type uname followed by a space to confirm the command is available. If the system responds with an error indicating the command is not found, you may be using a very minimal or custom shell environment that lacks the standard uname utility.
  3. Run the Command: Type uname -r and press Enter. The -r flag tells the system to display only the kernel release. The output will be a string of numbers and dashes, such as 5.15.0-91-generic or 4.18.0-372.9.1.el8_6.x86_64. This is the primary version you are looking for.
  4. View Full Build Information (Optional): To see more context about the kernel, type cat /proc/version and press Enter. This command reads the /proc/version virtual file, which contains the kernel version string, the username of the person who built it, the hostname of the machine, and the compiler version used to build the kernel.
  5. Check Kernel Name (Optional): If you need to know which kernel architecture your system is running (e.g., x86_64, aarch64, armv7l), type uname -m and press Enter.
  6. Verify Boot Kernel: To see which kernel was actually used to boot the system, type uname -v and press Enter. This may show details about the boot time and the specific configuration.

Common Mistakes

One frequent error is confusing the kernel version with the operating system version or the distribution version. For example, the command lsb_release -a displays the Linux Standard Base (LSB) information, which tells you which distribution you are using (like Ubuntu 22.04) and its code name, but not the underlying kernel version. The kernel version is managed by the Linux kernel project and can be updated independently of the distribution's software repositories.

Another mistake is assuming that the output of uname -r is the only version number that matters. In some complex environments, especially those using containerization or virtual machines, the host kernel version may differ from the kernel version running inside the container. The commands shown above will report the kernel of the host system, not the container.

Tips

When troubleshooting hardware compatibility or software issues, it is often helpful to keep the kernel version handy. You can save the output of the command to a text file for later reference by typing uname -r > kernel_version.txt. This allows you to easily share the exact version with support teams or forums.

For users who prefer a graphical interface, some systems offer a dedicated system information tool. However, these tools often aggregate data from multiple sources and may not clearly distinguish between the kernel version and the distribution version. Using the terminal commands is the most reliable way to get the exact kernel release string.

Troubleshooting

If the command uname returns an error saying it is not found, your shell may be using a minimal subset of utilities. You can try using the /usr/bin/uname path explicitly, or switch to a standard shell like /bin/bash or /bin/sh by typing bash and pressing Enter before running the command again.

If the output looks strange or contains garbled characters, ensure your terminal is set to display UTF-8 characters correctly. This is usually the default setting, but if you are connecting to a remote server via SSH, you may need to specify the character set in your SSH client configuration.

Frequently Asked Questions

Does the kernel version change automatically?

No, the kernel version does not change automatically. You must manually install a newer kernel version from your distribution's repositories or compile a new one from the source code. However, some distributions offer a kernel update mechanism that will notify you and prompt you to install the update.

How do I check the kernel version on macOS or Windows?

The commands uname and /proc/version are specific to Linux and Unix-like systems. On macOS, you can use the command uname -r in the Terminal. On Windows, you can right-click "This PC" or "My Computer", select "Properties", and look for the "System type" or "Edition" section, which will list the OS version including the Windows build number.

What is the difference between uname -r and uname -v?

The -r flag (release) gives you the version number string, such as 5.15.0-91-generic. The -v flag (version) gives you the detailed build information, including the boot time and specific configuration, such as #101-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023.

Why do I need to know my kernel version?

You might need to know your kernel version to troubleshoot hardware drivers, check compatibility with specific software, or report a bug. Many developers and support teams require the kernel version to reproduce the issue effectively.

Can I run a different kernel version alongside my current one?

Yes, most Linux distributions allow you to install multiple kernel versions. You can then select which kernel to boot into during startup. This is useful for testing a new kernel version without risking stability or losing access to your current system.