Have you ever used a Linux system? If you have, you know it’s a completely different world. You might be sitting in front of your terminal, something breaks, or you encounter an error, and suddenly you’re wondering, “What OS version of Linux or Ubuntu am I actually using?”
Linux isn’t just one operating system. It’s a collection of different distributions, each with its own OS version. You’ll find Ubuntu, Fedora, CentOS, Debian, Arch, and dozens of others. While they all run on the Linux kernel, each distribution handles things a bit differently depending on the OS version it’s based on.
Understanding Linux Versions
Let’s see different linux distribution (distro) before checking linux version. A distro is short form of “distribution”, which means someone packaged Linux with a bunch of tools and called it their own thing. Each distro is customized for different requirements, if it is for desktops, servers, or developers.
- Ubuntu: It is easy to use and with a big support community
- Debian: It is super stable version, and we can say that it is grandpa of Ubuntu
- Fedora: It has the latest features and cutting-edge stuffs
- CentOS/RHEL (Red Hat Enterprise Linux): It is a reliable and it is used in business
- Arch Linux: It is for advanced users who like to set everything up themselves
Each of the version stores their info a little differently. There is no universal command that works for all of the versions. However, we can check it easily. For example, Ubuntu use tools like lsb_release or files like /etc/os-release. The older Red Hat version based systems uses /etc/redhat-release instead.
Why Knowing Your Linux OS Version Matters
If you are working with a Linux system, knowing the exact version of your operating system is mandatory. Even if everything is running smoothly, here are some reasons that keep track of your operating system version:
1. Software Compatibility
All software can not run on every Linux version. Many tools and applications are customized to do work with specific versions or distributions. For example, a package that is meant for Ubuntu 22.04 can not properly run on Ubuntu 18.04 version. If you don’t have the right version for your package, you can face the installation issues or kind of system instability. That is why knowing your operating system version is mandatory and it can save you from the headaches.
2. Security and System Updates
Security patches always released for specific versions of Operating System. Outdated version patches can leave your system exposed to known vulnerabilities. By knowing which version you’re using, you can keep track for security updates and so that your system can stay protected against threats.
3. Faster Troubleshooting and Support
When you face any issue with your system and you search online for help from any forums, documents, or from any professional support, one thing you always asked for is that, “What version of Linux you are using?” That’s because solutions can vary based on the version of your system and the distros. Having this information with you can speed up the troubleshooting process and give fast and quick resolutions.
How to Check Your Linux OS Version
Linux users have to rely on the command line, and checking your Operating System version is necessary. The good news is that, you don’t need to install any extra tools to know the version of your OS. A few simple commands in the terminal and you will get the details of your OS that you need.
Let’s explore the most commonly used commands.
Using cat /etc/os-release
This is the most common method and works on nearly all modern Linux distributions. This file has all the information for your Operating System.
Command:
cat /etc/os-release
Sample Output:
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian

What It Means:
- NAME and PRETTY_NAME: These give the user-friendly distro name.
- VERSION: This shows the detailed version including codename.
- ID and ID_LIKE: Useful for scripting and automation.
This approach is a quick, for this you don’t need to install anything extra. Since it works the same way on most Linux distributions, it is a popular and trusted method for checking system details.
Using lsb_release -a
Another method that uses to check the Operating System details in Linux is by running the lsb_release -a command. It generate the information from Linux Standard Base (LSB), and will give you a clear output. This is useful when you are writing a scripts or creating documentation, as the format is very easy to read and simple to work with.
Command:
lsb_release -a
Sample Output:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy

Breakdown:
- Distributor ID: Tells you the base distro (e.g., Ubuntu).
- Description: A human-readable OS name and version.
- Release: The version number.
- Codename: The development codename used internally.
This command works well on debian-based systems like Ubuntu and Linux Mint because it give consistent and proper results. But note that, it is not always available for every distro. If you face an error that is “command not found”, you’ll have to install it manually using below command:
sudo apt install lsb-release # For Debian/Ubuntu
sudo yum install redhat-lsb # For RHEL/CentOS
If you’re an admin and managing multiple systems or writing customized scripts for specific operating systems, lsb_release -a can be a real time saver. It provides a well-structured, and easy-to-understand information that is perfect for automation and scripting tasks.
Using hostnamectl
The hostnamectl command is a tool that do more than just show your Operating System version, it also gives you useful system details like the hostname, machine ID, hardware architecture, and many more, all in one place.
Command:
hostnamectl
Sample Output:
Static hostname: n/a
Transient hostname: meghna-Latitude-7490
Icon name: computer-laptop
Chassis: laptop
Machine ID: 45b9c35e42c74e4ba5d41dcbf53dda2e
Boot ID: ad41b27886554a9284a2d75801ccd259
Kernel: Linux 6.8.0-60-generic
Architecture: x86-64
Hardware Vendor: Dell Inc.
Hardware Model: Latitude 7490

Highlights:
- Operating System: Shows the current OS version.
- Kernel: Gives your Linux kernel version.
- Architecture: Helps when choosing compatible software.
One of the best things about hostnamectl is that it works seamlessly with systemd, which is used by most modern Linux distributions such as Fedora, CentOS 7 and above, and Ubuntu 16.04 and later. It’s a convenient command that gives you key system information without needing to check multiple files.
If you’re managing up-to-date Linux servers or cloud-based VMs, hostnamectl is a simple and efficient way to get OS details quickly, without any hassle.
Using /etc/issue
If you’re managing up-to-date Linux servers or cloud-based VMs, hostnamectl is a simple and efficient way to get OS details quickly, without any hassle.
Command:
cat /etc/issue
Example Output:
Ubuntu 22.04.5 LTS \n \l

While it might be considered old-school, the /etc/issue file can still come in, especially when you’re dealing with older Linux systems or lightweight setups that don’t include modern tools. That said, it’s not the most reliable option for automation or anything security-related, as the file can be easily edited or customized.
Using uname -a
The uname command will not give you the exact OS version, but it is still useful because it shows important details about the system’s kernel. When you add the -a flag, it displays a wide range of system information in one command, which can be helpful for troubleshooting or system checks.
Command:
uname -a
Sample Output:
Linux meghna-Latitude-7490 6.8.0-60-generic #63~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 22

Output Explained:
- Linux: The system kernel name.
- meghna-Latitude-7490: Hostname.
- 6.8.0-60-generic: Kernel version.
- #63~22.04.1-Ubuntu SMP…: Kernel build info.
- x86_64: Architecture type.
- GNU/Linux: Operating system type.
This command is especially helpful when you’re dealing with kernel-related problems or checking for compatibility. Some drivers and kernel modules rely on the kernel version rather than the OS version, so knowing this information is very helpful. While uname -a does not replace tools like lsb_release or cat /etc/os-release, it gives you valuable details that work with them to give a full details of your system.
Using /proc/version
If you’re curious about what compiler and build tools were used to build your Linux kernel, just check out /proc/version. This special file is created by the kernel itself and gives you detailed low-level information that can be really handy for developers and system administrators.
Command:
cat /proc/version
Example Output:
Linux version 6.8.0-60-generic (buildd@lcy02-amd64-098) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #63~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 22 19:00:15 UTC 2

Key Info:
- Kernel version and patch level.
- Build user and environment.
- GCC and binutils version used.
Why does this matter?
If you’re debugging the kernel modules or trying to recreate a specific setup, in that case knowing exactly how the kernel was built can make all the difference. These details can help you to match environments, catch compatibility issues, and ensure everything is works as expected. It’s also a good way to check your kernel version when other commands not working.
While /proc/version might not be the first thing that comes to mind, it’s packed with raw kernel metadata. When you need the low-level details, it’s one of the most direct sources you’ve got.
Distro-Specific Commands
The general tools we’ve talked about work on most Linux systems, but sometimes you’ll want more tailored information. That’s where distro-specific commands come in, they often provide more precise version data and system info, especially if your go-to tools aren’t installed.
Ubuntu and Debian-based Systems
If you’re running something like Ubuntu, Linux Mint, Pop!_OS, or another Debian-based distro, you’re in good shape. These systems are well-documented and offer several ways to check your OS version and system details with ease.
Common Files and Commands:
- /etc/os-release – The most consistent.
- lsb_release -a – Standard on most Ubuntu systems.
- /etc/lsb-release – A Debian-specific file.
Red Hat, CentOS, and Fedora
These systems use their own tools and files to track version info, which makes them easy to identify for scripts and automation.
Example:
- /etc/centos-release
- /etc/redhat-release
- /etc/fedora-release
- /etc/system-release
Each of these files gives a clear picture of what OS and version you’re using. Unlike Ubuntu, these files aren’t just symbolic, many internal tools and packages use them for version verification.
Arch Linux and Derivatives
Arch Linux plays by its own rules. It’s a rolling-release system, so versioning is slightly different. There’s no traditional “version number” like in Ubuntu or Fedora; instead, updates are continuous. However, to find release info, you can still try:
- cat /etc/os-release
For specific package versions, including the base system:
- pacman -Q | grep -i release
How to Check Kernel Version
Now that you know how to check your Linux OS version, it’s just as important to know how to check your kernel version. The kernel is the heart of the system, it manages how software talks to hardware. You can actually have the same OS version as someone else but be running a completely different kernel, especially if you’ve done custom updates or tweaks.
- uname -r for Kernel Release
The simplest way to get your kernel version is:
uname -r
Sample Output:
6.8.0-60-generic

This shows the kernel version your system is currently running on. Each part of this string means:
- 6.8.0: Major and minor kernel version.
- 60: Patch number or release iteration.
- generic: Indicates it’s a standard, general-use kernel.
Why this is important? Because some of drivers, security tools, and system features work with certain kernel versions. If you are working with hardware directly or managing a system that need to stay online 24/7, in that case knowing your kernel version can help you to avoid a lot of headaches and time.
Common uname commands are as follow:
- uname -a (Prints all system information)
- uname -m (Prints machine hardware name)
- uname -n (Prints hostname)
- uname -p (Prints processor type)
- uname -r (Prints kernel release number)
- uname -s (Prints kernel name)
- uname -v (Prints kernel version)
Troubleshooting Common Errors
- Checking your Linux Operating System version is a simple, but there are a few common problems that can cause confusion. Here are some of the problems you might run into, and how to deal with them:
1. Command Not Found
If you try lsb_release -a and get a response with “command not found” error, the utility may not be installed. Fix it with:
Debian/Ubuntu:
sudo apt install lsb-release
CentOS/RHEL:
sudo yum install redhat-lsb-core
2. Missing Files
Some older or minimalist systems may not have the /etc/os-release. In that case, you need to try:
- /etc/issue
- /etc/debian_version
- /etc/redhat-release
3. Permission Issues
Usually, user don’t need root access to read the files like /proc/version, but on the systems which are locked, user might get the restrictions for permission. If that happens, try using sudo, just make sure you trust the system before doing so.
4. Misreading the Info
It’s easy to mix up the kernel version (uname -r) with the Operating System version. They’re related, but they are for different purposes. Always check the right one depending on what you’re trying to do.
These simple tips can save your time and help you to avoid frustration when things are not working the exact way that you expect.
Conclusion
If you don’t yet know that how to check your Linux OS version, now it is the perfect time to learn. It is easier than you think, and once you know where to look, you’ll have a better handle on what your system is running.
Understanding your Linux operating system version isn’t just a technical skill, it’s a fundamental step for good and secure system management. Whether you are installing a new software, applying any security update, or finding a help for any issue online, knowing your exact Linux distribution and version is must required. It can save time, prevent errors, and keep your system running safely and efficiently.
With so many distros out there, from Ubuntu and Fedora to Arch and CentOS, there is no one-size-fits-all command, but, there are reliable ways to get the information you need. Whether you’re using cat /etc/os-release, lsb_release -a, hostnamectl, or even uname -r, each command gives you result based on the system.
Linux may feel complex at very first, but once you get familiar with these basic commands, managing your environment becomes much more approachable, and even enjoyable. No matter if you’re developing applications, running production servers, or just managing a home lab, understanding your system’s basic information is a key. When you know your OS and kernel inside out, you’re in full control, and that’s what being a Linux user is all about.
FAQs
1. How do I check OS version in Linux without root?
Yes! Any one can run most commands such as cat /etc/os-release, lsb_release -a and uname -a. There’s no need for them to request root.
2. How to upgrade to a newer version of Linux?
The updating is dependent on your distro:
- Ubuntu/Debian: sudo apt update && sudo apt upgrade
- CentOS/RHEL: sudo yum update
- Always back up your data and check compatibility before upgrading.
3. Is kernel the same as OS?
Not quite. The kernel is only one aspect of the OS. Your system might be running disparate kernel versions on the same OS release, if you’ve tweaked or upgraded the kernel separately in some way.
4. What if lsb_release is not found?
Install it using:
Ubuntu/Debian: sudo apt install lsb-release
Red Hat/CentOS: sudo yum install redhat-lsb-core
5. How often should I check my OS version?
Check during:
System setup
Before installing major software
Quarterly audits
After system updates or patches
🚨 Note: ServerAvatar is powerful and user-friendly server and application management panel and hosting platform. It simplifies server management and makes deploying PHP applications like WordPress, Laravel, and others easy, even for non-experts.
If you’re looking to manage your server efficiently without dealing with complex command-line, you can try ServerAvatar for a fully hands-off experience.
Register now to explore ServerAvatar: https://app.serveravatar.com