How to Check Linux Version
This article explains how to identify the installed Linux distribution and determine its version when you are unsure whether the system is running Ubuntu, AlmaLinux, CentOS, or another Linux distribution.
Applies To
Linux
Ubuntu
AlmaLinux
CentOS
Red Hat Enterprise Linux (RHEL)
Rocky Linux
Debian-based distributions
Steps
Method 1: Check the Operating System Release File (Recommended)
Open a terminal and run:
cat /etc/os-release
Method 2: Display Distribution Information Using hostnamectl
Open a terminal and run:
hostnamectl
Method 3: Check Kernel Version
Open a terminal and run:
uname -r
uname -a
Method 4: Check Distribution-Specific Release Files
Open a terminal and run:
cat /etc/*release
cat /etc/lsb-release
cat /etc/redhat-release
Method 5: Check Using lsb_release
Open a terminal and run:
lsb_release -a
Verification
Confirm that the output identifies the distribution name, version, and kernel version. The recommended command is: cat /etc/os-release
Troubleshooting
If lsb_release is not found, install lsb-release on Ubuntu/Debian or redhat-lsb-core on AlmaLinux/CentOS/RHEL. If release files are missing, run cat /etc/*release and collect outputs from os-release, hostnamectl and uname -a.
- Linux
- Linux Cloud Servers
- Linux Version
- Version check
- Version
