Software installation instructions can ask which Linux distribution and release is installed, while other checks need the kernel release instead. Linux version commands show either the installed distribution’s release or the running kernel’s release.
I’ll show how to read the distribution release from /etc/os-release and check the kernel release separately.
TL;DR: Find the Linux distribution version
Run cat /etc/os-release to see the distribution name and release on a modern Linux system.
- Read PRETTY_NAME for a human-readable name.
- Read VERSION_ID for the release identifier when present.
- Use uname -r only when you need the running kernel version.
What does “Linux version” mean?
Linux version can refer to the distribution release or to the Linux kernel release. The distribution is the operating system you use, such as Ubuntu or Debian, while the kernel is the core that manages hardware and system processes.
These identifiers answer different questions. A software installer may ask for your distribution and release, while a driver or kernel troubleshooting guide may ask for the kernel version. The commands below make that distinction visible instead of treating one number as both.
The /etc/os-release file is a useful starting point on modern Linux distributions. It contains operating-system identification fields in a format intended for programs and people to inspect.
How to find the Linux version step by step
Start with the release file, then use a system summary or LSB report if you need another view. These are read-only checks and do not change system settings.
Step 1: Read /etc/os-release
Run this command in a terminal to print the distribution’s identification fields:
cat /etc/os-release
The command output is shown below:
PRETTY_NAME="Ubuntu 24.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.5 LTS (Noble Numbat)"
VERSION_CODENAME=noble
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=noble
LOGO=ubuntu-logo

PRETTY_NAME gives a readable label, while VERSION_ID is the concise release number. In this output, the distribution is Ubuntu 24.04.5 LTS and the codename is Noble Numbat. Fields differ by distribution, so scripts should not assume every optional field exists.
I ran cat /etc/os-release and it returned Ubuntu 24.04.5 LTS with VERSION_ID=24.04. That confirms the command reports the installed distribution release, not the kernel version.
Step 2: Check the system summary with hostnamectl
Run hostnamectl when it is available. It reports host information on systems that use systemd, and commonly includes separate Operating System and Kernel lines.
hostnamectl | grep -E "Operating System|Kernel"
Find the Operating System line for the distribution and the Kernel line for the running kernel. This is a useful single-screen overview, but it depends on the systemd command being installed and usable in the current environment. A minimal container or a system that does not run systemd may not provide it.
Here is the same command’s output, limited to the two version fields so the host metadata stays out of the example:
Operating System: Ubuntu 24.04.5 LTS
Kernel: Linux 7.0.0-1013-oracle

The labels make the distinction explicit. On a system where hostnamectl is absent or cannot contact systemd, skip this check and use the release file instead.
Step 3: Use lsb_release when installed
The lsb_release utility prints distribution details in a familiar format. Check all supported fields with:
lsb_release -a
The command returned these fields:
Distributor ID:\tUbuntu
Description:\tUbuntu 24.04.5 LTS
Release:\t24.04
Codename:\tnoble

Look for Distributor ID, Description, Release and Codename. The -a option requests all information available through this utility. Ubuntu’s implementation can use /etc/os-release or /usr/lib/os-release as its data source.
If the shell reports command not found, the utility is not installed or is not on your command path. You can use cat /etc/os-release to identify the release instead of installing this optional utility.
Step 4: Check the kernel release separately
Use uname -r when a guide asks for the running Linux kernel version:
uname -r
The command returned this kernel release:
7.0.0-1013-oracle

This prints the kernel release string. It does not identify whether the distribution is Ubuntu, Fedora, Debian or another system. For a deeper explanation, see how to find the Linux kernel version.
Common issues when checking the Linux version
Use the release file when an optional reporting command is missing, and keep the distribution release separate from the kernel release. These checks describe the environment where each command runs.
- If hostnamectl is unavailable or cannot contact systemd, read /etc/os-release and use uname -r for the kernel.
- If lsb_release returns command not found, read /etc/os-release instead.
- If /etc/os-release is missing, check /usr/lib/os-release and consult the distribution documentation.
- In a container, the release file describes its filesystem, while the kernel is commonly shared with the host. Run the checks in the environment relevant to the problem.
For older systems, /etc/issue may show a login banner, but administrators can customize it. Treat that text as a clue rather than a dependable release record.
Which Linux version command should you use?
Choose the command based on the information you need and the tools present. For a general answer, read /etc/os-release first because it avoids depending on optional reporting utilities.
| Command or file | What it identifies | When to use it |
|---|---|---|
| cat /etc/os-release | Distribution name and release fields | First check on modern Linux |
| hostnamectl | Systemd host summary, often OS and kernel | When systemd is available |
| lsb_release -a | LSB-style distribution report | When the utility is installed |
| uname -r | Running kernel release | When the question is specifically about the kernel |
A version check does not identify the machine’s CPU architecture. Query that separately if a download asks for it.
For older distributions, release files may have distribution-specific names. The /etc/issue file may show a login banner rather than a dependable release record. Its contents can include terminal escape sequences or local text, so treat it as a banner rather than a version database.
The file format defines /etc/os-release as the machine-specific file. It takes precedence over /usr/lib/os-release when both exist.
When checking files manually, read the etc path first. The vendor file is a fallback when the machine-specific file is absent.
Keep the release-file fields in context when a support form asks for a version. The readable PRETTY_NAME line may include a point release and a long-term-support label.
VERSION_ID often carries the shorter release number that scripts and package documentation expect. Distributions may omit fields or add their own, so compare the actual field name before using it.
Names and identifiers serve separate purposes. NAME is a familiar product name, while ID is a compact machine-oriented identifier such as ubuntu.
ID_LIKE can indicate a related distribution family. It does not provide the release number. If a troubleshooting page asks for a particular value, copy that named field rather than the first number you see.
A release codename can help when a project’s instructions use names such as noble or bookworm. It is optional metadata, not a guarantee that every distribution publishes codenames in the same format. Check the documented release identifier if a package source or support page asks for a specific version string.
The release file describes the installed operating system. It does not say whether the system has pending updates or whether it is still supported. For those questions, consult the distribution’s official release and support pages after identifying the correct distribution and release.
Some systems expose both /etc/os-release and /usr/lib/os-release. The standardized arrangement reads the machine-specific etc file in preference to the vendor file.
Check the selected file rather than combining both outputs, so each value remains tied to its source.
If /etc/os-release is missing, check whether /usr/lib/os-release exists. Either file may be absent on old systems or unusual minimal images.
A distribution-specific release file can then provide a clue, but its location and format vary. Consult the distribution’s documentation to identify its current file.
The /etc/issue file has a different job. It can provide text displayed before a login prompt, and administrators can customize it.
Character sequences may be interpreted by the login program, so this file can contain placeholders rather than a plain version. Treat it as a banner rather than as a compatibility source.
A container can report the distribution files present in its own filesystem, which may differ from the host operating system. The kernel, however, is shared with the host in common container setups. When checking a container, say whether the question concerns the container image or the host kernel before sending version details to a support team.
Virtual machines have their own guest distribution and kernel. A guest release file identifies the installed guest OS, while its kernel command reports the guest kernel.
These commands do not identify the hypervisor or host distribution. Check the virtualization platform separately if the issue concerns the underlying machine.
Windows Subsystem for Linux presents a Linux environment with distribution files. The release file identifies the Linux distribution installed in that environment.
It does not identify the Windows release. Check Windows system information when an installer or support request asks for that host version.
When reporting a result, include the field that answers the request rather than pasting every line. For a distribution question, PRETTY_NAME is often clear to a person.
For a script or compatibility check, ID and VERSION_ID may be more precise. Keep the spelling and punctuation from the output when a support form expects a value.
A kernel version can change after an update or reboot without changing the distribution release. The reverse can also happen: a distribution release upgrade may include a different kernel, but the two numbers still describe separate components. Record both only when the task asks for both, and label each value so a reader does not mistake one for the other.
On a graphical desktop, look for an About page in the system settings. Its location and label depend on the desktop environment and distribution. This route can help when a terminal is unavailable, but use the release file when you need a value to copy into a support request or script.
A screenshot of a settings panel is not a reliable substitute for checking the underlying host when you are working through a remote shell. The visible desktop might belong to a different machine or session. Run the command in the same environment where the software or error occurs.
For an application download, use the release details to find the matching package instructions. A label such as Ubuntu 24.04.5 LTS contains both the distribution and its release family. Confirm the application’s supported releases in its own documentation because a matching name alone does not guarantee compatibility.
For a server support ticket, include the requested distribution field and the kernel field only when asked. The hostnamectl summary keeps these labels together, while the release file focuses on OS identification. This makes it clearer to send the value the support team requested without mixing the guest’s distribution with its kernel.
Conclusion: identify the distribution first
Read the distribution name and release fields in /etc/os-release. Switch to uname -r only when you need the kernel release, and use hostnamectl or lsb_release as alternatives when available.
For related command-line checks, see the Linux commands cheat sheet and our guide to the cat command.
FAQ
These answers separate common distribution and kernel version questions.
How do I find the Linux OS version?
Run cat /etc/os-release and read PRETTY_NAME or VERSION_ID for the distribution release.
How do I find the Linux kernel version?
Run uname -r to print the running kernel release. This does not identify the Linux distribution.
What if lsb_release is not found?
Use cat /etc/os-release instead. lsb_release is an optional utility and is not installed on every system.
