If you are new to Linux or just need to troubleshoot a system, knowing your exact software environment is crucial. This guide will show you how to check Linux version using simple commands and tools. Your Linux version appears with `uname -r` for kernel version or `cat /etc/issue` for distribution release.
Linux is not a single operating system. It comes in many distributions (distros) like Ubuntu, Fedora, Debian, and CentOS. Each distro has its own release number and kernel version. Knowing these details helps you install compatible software, apply the right security patches, and get support from forums.
In this article, you will learn multiple methods to check your Linux version. We will cover command-line tools, graphical interfaces, and special files. By the end, you will be able to identify your system quickly and confidently.
Why You Need To Know Your Linux Version
Before jumping into the commands, let’s understand why this matters. Every Linux distribution releases updates and security fixes for specific versions. If you run an outdated version, you might miss critical patches. Also, software packages often require a minimum kernel or glibc version. Checking your version prevents installation errors.
Another reason is troubleshooting. When you ask for help online, people need to know your exact distro and version. Saying “I use Linux” is not helpful. Providing “Ubuntu 22.04 LTS with kernel 5.15” gives precise context.
How To Check Linux Version Using The Command Line
The terminal is the most reliable way to get version information. Below are the most common commands. You can run them in any terminal emulator.
Using The uname Command
The uname command stands for “Unix name.” It prints system information. The most common use is uname -r to show the kernel release number.
Open a terminal and type:
uname -r
This will output something like 5.15.0-91-generic. The first part (5.15.0) is the kernel version. The rest is distribution-specific build info.
For more details, use uname -a. This shows all system information, including the hostname, kernel name, and architecture.
uname -a
Example output: Linux myhost 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
This tells you the kernel version, build date, and architecture (x86_64 means 64-bit).
Using The lsb_release Command
Most modern Linux distributions follow the Linux Standard Base (LSB). The lsb_release command shows distribution-specific information. It is available on Ubuntu, Debian, Fedora, and many others.
Type:
lsb_release -a
This prints the Distributor ID, Description, Release number, and Codename. For example:
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
If the command is not found, you may need to install the lsb-release package. On Debian/Ubuntu, run sudo apt install lsb-release.
Reading The /etc/os-release File
Almost every Linux distribution includes a file at /etc/os-release. This file contains key-value pairs with system information. You can view it with cat or less.
cat /etc/os-release
Typical output:
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
LOGO=ubuntu-logo
This file is reliable because it is maintained by the distribution maintainers. It works even on minimal installations.
Checking The /etc/issue File
The /etc/issue file contains a short text that is often displayed before the login prompt. It usually shows the distribution name and version.
cat /etc/issue
Example output: Ubuntu 22.04.3 LTS \n \l
This is a quick way to see the distro version, but it may not be as detailed as other methods.
Using The hostnamectl Command
If your system uses systemd (most modern distros do), the hostnamectl command shows system information including the operating system and kernel.
hostnamectl
Output example:
Static hostname: myhost
Icon name: computer-vm
Chassis: vm
Machine ID: abc123...
Boot ID: def456...
Virtualization: oracle
Operating System: Ubuntu 22.04.3 LTS
Kernel: Linux 5.15.0-91-generic
Architecture: x86-64
This command is clean and easy to read. It gives both the OS name and kernel version.
How To Check Linux Version Using A Graphical Interface
If you prefer not to use the terminal, most desktop environments provide graphical tools. These are especially useful for beginners.
On GNOME Desktop
GNOME is the default desktop for Ubuntu, Fedora, and many others. Click on the Activities menu (top-left corner) and type “Settings.” Then go to the “About” section. You will see the OS name, version, and kernel details.
Alternatively, you can open the “Settings” app from the system menu. Look for “About” or “System” in the left sidebar.
On KDE Plasma
In KDE, click on the application launcher (usually bottom-left). Search for “System Settings.” Then go to “About This System.” It shows the distribution name, version, and kernel.
On Other Desktops
Most desktop environments have a system information panel. Look for “About,” “System Info,” or “Details” in the settings menu. If you cannot find it, you can always fall back to the terminal commands.
How To Check Linux Version On Specific Distributions
Some distributions have their own unique files or commands. Here are the most common ones.
Ubuntu And Debian
On Ubuntu, the lsb_release -a command works perfectly. You can also check /etc/os-release. For Debian, the same commands apply. Additionally, Debian has a file at /etc/debian_version that shows the Debian version number.
cat /etc/debian_version
This outputs something like 11.6 for Debian 11 (Bullseye).
Red Hat Enterprise Linux (RHEL) And CentOS
On RHEL and CentOS, use cat /etc/redhat-release or cat /etc/centos-release. These files contain the exact version string.
cat /etc/redhat-release
Example: CentOS Linux release 7.9.2009 (Core)
You can also use rpm -q centos-release on CentOS or rpm -q redhat-release on RHEL.
Fedora
Fedora uses /etc/fedora-release. Run:
cat /etc/fedora-release
Output: Fedora release 38 (Thirty Eight)
Alternatively, rpm -q fedora-release works.
Arch Linux
Arch Linux is a rolling release, so there is no fixed version number. However, you can check the kernel version with uname -r. The file /etc/os-release shows “Arch Linux” as the ID.
OpenSUSE
On openSUSE, use cat /etc/os-release or cat /etc/SuSE-release (older versions). The command zypper --version also shows the package manager version which correlates with the distro release.
How To Check The Kernel Version
The kernel version is often more important than the distribution version. Here are the best ways to get it.
Using uname -R
This is the standard command. It returns only the kernel release number.
Using uname -V
This shows the kernel version and build date. For example: #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023
Checking /proc/version
The virtual file /proc/version contains a single line with kernel version and compiler info.
cat /proc/version
Output: Linux version 5.15.0-91-generic (buildd@lcy02-amd64-052) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023
How To Check The Architecture (32-Bit Or 64-Bit)
Knowing your system architecture is important for downloading the correct software. Use uname -m.
uname -m
If it returns x86_64, you have a 64-bit system. If it returns i686 or i386, it is 32-bit. For ARM systems, you might see aarch64 or armv7l.
Another command is arch, which does the same thing.
How To Check The Desktop Environment Version
Sometimes you need to know the desktop environment (GNOME, KDE, Xfce) version. This is not directly related to the distro version, but it can be useful.
GNOME
Run gnome-shell --version or check the About panel in Settings.
KDE
Use plasmashell --version or look in System Settings under “About.”
Xfce
Run xfce4-about --version or check the About dialog in the menu.
Common Mistakes When Checking Linux Version
Here are some pitfalls to avoid.
- Relying only on
uname -rfor the distro version. This gives the kernel, not the distribution release. - Assuming all Linux systems have
lsb_release. Some minimal installations do not include it. - Forgetting that some commands require root privileges. For example,
rpm -qmay need sudo on some systems. - Confusing the kernel version with the distribution version. They are different things.
- Using
cat /etc/issueon systems where it is not updated. Some distros do not maintain this file.
How To Automate Version Checking In Scripts
If you manage multiple servers, you can write a script to check versions automatically. Here is a simple bash script example.
#!/bin/bash
echo "Kernel version: $(uname -r)"
echo "Distribution: $(cat /etc/os-release | grep PRETTY_NAME | cut -d= -f2 | tr -d '\"')"
echo "Architecture: $(uname -m)"
Save this as check_version.sh, make it executable with chmod +x check_version.sh, and run it. This gives you a quick summary.
For more detailed reports, you can use hostnamectl or parse /etc/os-release with source command.
How To Check Linux Version On A Remote Server
When you SSH into a remote server, the same commands work. Just open a terminal on your local machine and connect via SSH. Then run the commands as usual.
Example:
ssh user@server_ip
uname -r
cat /etc/os-release
You can also combine commands in one line:
ssh user@server_ip "uname -r; cat /etc/os-release"
This saves time when checking multiple servers.
How To Check Linux Version In Containers
Docker containers run a minimal Linux environment. Inside a container, you can still use uname -r and cat /etc/os-release. However, the kernel version shown is the host kernel, not a container-specific kernel. The distribution version shown is the one from the base image.
For example, if you run an Ubuntu container on a Fedora host, cat /etc/os-release will show Ubuntu, but uname -r will show the Fedora host’s kernel.
How To Check Linux Version On WSL (Windows Subsystem For Linux)
WSL users can use the same commands. Open your WSL terminal (Ubuntu, Debian, etc.) and run:
uname -r
cat /etc/os-release
WSL2 uses a real Linux kernel, so uname -r will show the WSL kernel version. The distribution version is whatever distro you installed from the Microsoft Store.
Frequently Asked Questions
What is the difference between kernel version and distribution version?
The kernel version is the core of the operating system (e.g., 5.15.0). The distribution version is the release of the entire OS package (e.g., Ubuntu 22.04). They are independent; you can have the same kernel on different distros.
How can I check my Linux version without using the terminal?
You can use the graphical settings panel. On GNOME, go to Settings > About. On KDE, go to System Settings > About This System. Other desktops have similar options.
Why does lsb_release -a not work on my system?
The lsb-release package may not be installed. Try installing it with your package manager (e.g., sudo apt install lsb-release on Debian/Ubuntu). Alternatively, use cat /etc/os-release.
Can I check the Linux version on an embedded system?
Yes. Most embedded Linux systems (like Raspberry Pi OS) support the same commands. Use uname -a and cat /etc/os-release. Some may have limited output if they use BusyBox.
How do I check the version of a specific package?
Use the package manager. For example, apt show package_name on Debian/Ubuntu, rpm -q package_name on RHEL/Fedora,