15%

Save 15% on All Hosting Services

Test your skills and get Discount on any hosting plan

Use code:

Skills
Get Started
11.08.2025

How to Find Your Linux Version: A Complete Guide for All Distributions

Whether you're managing a personal workstation, a cloud-based VPS Hosting environment, or a Dedicated Server, knowing your exact Linux version is one of the most fundamental skills in system administration. It directly impacts software compatibility, security patch management, troubleshooting accuracy, and the ability to follow distribution-specific documentation correctly.

In this comprehensive guide, we'll walk you through every reliable method to identify your Linux version — from fast terminal one-liners to graphical desktop interfaces — covering all major distributions including Ubuntu, Debian, CentOS, Fedora, Arch Linux, and more.

Why Knowing Your Linux Version Matters

Before diving into the commands, it's worth understanding why this information is so critical:

  • Software compatibility: Package managers and application installers often require a specific distribution and release version to function correctly.
  • Security and updates: Knowing your OS version ensures you're applying the right security patches and haven't fallen behind on end-of-life (EOL) releases.
  • Accurate troubleshooting: Error messages, log formats, and system behavior can differ significantly between distributions and versions.
  • Support efficiency: When submitting a support ticket — whether to AlexHost or any vendor — including your Linux version helps technicians provide faster, more precise solutions.
  • Kernel and driver management: Certain hardware drivers, kernel modules, and system tools are version-dependent.

Method 1: Using the lsb_release Command

The lsb_release command (Linux Standard Base release) is one of the most widely used tools for retrieving human-readable distribution information. It is available by default on most Debian- and Ubuntu-based systems.

Command:

lsb_release -a

Example Output:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

This output gives you the full distribution name, the release number, and the version codename — all the information you typically need for software installation or support requests.

What If the Command Is Not Found?

If your system returns command not found, install the package using your distribution's package manager:

# Debian / Ubuntu
sudo apt install lsb-release

# CentOS / RHEL / AlmaLinux / Rocky Linux
sudo yum install redhat-lsb-core

# Fedora
sudo dnf install redhat-lsb-core

Method 2: Reading /etc/os-release

The /etc/os-release file is a standardized OS identification file present on virtually all modern Linux distributions. It is the most universally compatible method and works reliably across Ubuntu, Debian, CentOS, Fedora, Arch Linux, openSUSE, and others.

Command:

cat /etc/os-release

Example Output (Ubuntu 22.04):

NAME="Ubuntu"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 22.04.3 LTS"
VERSION_ID="22.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"

Example Output (CentOS Stream 9):

NAME="CentOS Stream"
VERSION="9"
ID="centos"
ID_LIKE="rhel fedora"
PRETTY_NAME="CentOS Stream 9"

This file is particularly useful in shell scripts and automation workflows where you need to programmatically detect the OS before executing distribution-specific commands.

Pro Tip: You can also read the shorter /etc/issue file for a quick one-line version summary:

cat /etc/issue

Method 3: Using hostnamectl

The hostnamectl command is part of the systemd suite and provides a broader snapshot of system identity, including the operating system, kernel version, and hardware architecture. It is available on any system running systemd (which covers the vast majority of modern Linux distributions).

Command:

hostnamectl

Example Output:

 Static hostname: my-server
       Icon name: computer-vm
         Chassis: vm
      Machine ID: a1b2c3d4e5f6...
         Boot ID: f6e5d4c3b2a1...
  Virtualization: kvm
Operating System: Ubuntu 22.04.3 LTS
          Kernel: Linux 5.15.0-78-generic
    Architecture: x86-64

This is especially useful when managing VPS Hosting environments, as it also reveals the virtualization technology in use (e.g., KVM, VMware, or LXC).

Method 4: Checking the Linux Kernel Version

The distribution version and the kernel version are two separate pieces of information. While the distribution version tells you which OS flavor you're running, the kernel version is critical for driver compatibility, system calls, and low-level debugging.

Check Kernel Version Only:

uname -r

Example Output:

5.15.0-78-generic

Check Full System Information:

uname -a

Example Output:

Linux my-server 5.15.0-78-generic #85-Ubuntu SMP Fri Jul 7 15:25:09 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

This single command reveals the hostname, kernel release, kernel version, build date, machine hardware, processor type, and OS.

FlagInformation Returned
uname -rKernel release version only
uname -vKernel version (build timestamp)
uname -mMachine hardware architecture
uname -oOperating system name
uname -aAll of the above combined

Method 5: Checking the Version via a Graphical Desktop Interface

If you're running Linux with a full desktop environment (GNOME, KDE Plasma, XFCE, etc.), you can find your OS version through the system settings without opening a terminal.

GNOME (Ubuntu, Fedora):

  1. Click the Activities button or open the Application Menu.
  2. Navigate to Settings → About.
  3. Your OS name, version, and GNOME version will be displayed.

KDE Plasma:

  1. Open the Application Launcher.
  2. Go to System Settings → About This System.
  3. Look for the Operating System section.

XFCE:

  1. Open the Application Menu.
  2. Navigate to System → About XFCE or check System Information in the settings manager.

Method 6: Checking Linux Version on a Remote VPS or Dedicated Server

This is the most common scenario for system administrators managing cloud infrastructure. If you're running a remote server — such as an AlexHost Dedicated Server or a VPS — you'll need to connect via SSH first.

Step 1: Connect via SSH

ssh username@your-server-ip

Replace username with your actual user (e.g., root or a sudo-enabled user) and your-server-ip with your server's IP address.

Step 2: Run Your Preferred Version Check Command

Once connected, use any of the methods above. The most reliable combination is:

lsb_release -a && uname -r

Or for maximum detail:

cat /etc/os-release && uname -a && hostnamectl

This gives you the full OS identification, kernel version, and system architecture in a single output — ideal for documentation or support requests.

> AlexHost Tip: When managing multiple servers, consider using a VPS Control Panel to centralize server management, monitor OS details, and streamline administrative tasks across your entire infrastructure.

Quick Reference: All Commands at a Glance

CommandWhat It ShowsWorks On
lsb_release -aFull distro name, version, codenameDebian, Ubuntu, CentOS (with package)
cat /etc/os-releaseStandardized OS identificationAll modern distributions
cat /etc/issueBrief OS version summaryMost distributions
hostnamectlOS, kernel, architecture, virtualizationsystemd-based distributions
uname -rKernel version onlyAll Linux distributions
uname -aFull kernel and system infoAll Linux distributions

Troubleshooting Common Issues

lsb_release: command not found

Install the lsb-release package using your distribution's package manager (see Method 1 above).

/etc/os-release returns minimal information

Some minimal or container-based Linux images strip out non-essential files. In this case, try cat /etc/issue or uname -a as fallbacks.

hostnamectl is not available

This command requires systemd. If your system uses a different init system (e.g., SysVinit or OpenRC), hostnamectl will not be present. Use cat /etc/os-release instead.

SSH connection refused on a remote server

Ensure SSH is enabled and your firewall allows port 22 (or your custom SSH port). If you've recently deployed a new server, check your VPS Hosting control panel for console access.

Choosing the Right Hosting for Your Linux Environment

The method you use to check your Linux version may also depend on the type of hosting environment you're running. Here's a quick overview of AlexHost solutions and what they offer:

  • VPS Hosting: Full root access, your choice of Linux distribution, and complete control over your environment. Ideal for developers and system administrators.
  • Dedicated Servers: Maximum performance and isolation. You have full hardware control and can install any Linux distribution.
  • Shared Web Hosting: Managed environment where the OS is handled by AlexHost. You may have limited terminal access, but cPanel or similar tools provide system information.
  • VPS with cPanel: A managed VPS with a graphical control panel, combining flexibility with ease of use.

Conclusion

Finding your Linux version is a simple but essential task that every system administrator and Linux user should know how to perform. Whether you prefer a quick one-liner like cat /etc/os-release, a comprehensive output from hostnamectl, or a graphical settings panel, there's a method that fits every workflow and experience level.

Key takeaways:

  • Use cat /etc/os-release for the most universally compatible method across all distributions.
  • Use lsb_release -a for a clean, human-readable output on Debian/Ubuntu-based systems.
  • Use uname -r or uname -a when you specifically need kernel version details.
  • Always include your Linux version when submitting support tickets or following installation guides — it ensures you receive the most accurate and efficient assistance.

> AlexHost Reminder: Always note your Linux distribution and version before making major system changes, installing new software, or reaching out to support. It saves time and prevents configuration errors that can be difficult to reverse.

15%

Save 15% on All Hosting Services

Test your skills and get Discount on any hosting plan

Use code:

Skills
Get Started