How to Check Your Ubuntu Version (5 Easy Methods)

Identifying your exact Ubuntu version is a fundamental step for system administration, package dependency verification, and troubleshooting. Various applications, software stacks, and container deployment blueprints require specific system releases to maintain operational stability. Before executing commands to install platforms like Docker, Kubernetes, Node.js, or modifying server environments, verifying the underlying operating system state prevents deployment conflicts.

The Linux environment inherently separates its identification criteria across files and tools. This practical guide covers five distinct methods applicable across both Ubuntu Desktop and headless Server distributions to extract distribution details accurately.

Why Verifying Your Ubuntu Release Matters

  • Software Stack Compatibility: Production-grade technologies specify exact framework compatibility bounds (e.g., node environments or PHP runtimes require particular compiler baselines provided by targeted OS distributions).
  • Security and Lifecycle Management: Standard Ubuntu releases receive maintenance for 9 months, whereas Long-Term Support (LTS) releases are maintained for 5 to 10 years. Verifying your baseline guarantees that your infrastructure continues to receive crucial security upgrades.
  • Automated Infrastructure Scripting: Production playbooks, configuration nodes, and remote continuous integration loops rely on structured metadata queries to apply correct packages.

Method 1: Using lsb_release (Recommended for Daily Administration)

The lsb_release utility provides Linux Standard Base (LSB) details about the current distribution. It is highly reliable for human interpretation as it formats system metadata uniformly.

Execute the following command to retrieve comprehensive release details:

lsb_release -a

Example terminal output response:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

Output FieldTechnical Definition
Distributor IDIdentifies the core distribution vendor baseline (Ubuntu).
DescriptionThe formal public-facing name of the operating system release.
ReleaseThe specific version number tracking the deployment year and month.
CodenameThe official development codename assigned to the release tree.

If you prefer a clean, singular layout restricted strictly to the release description, append the -d flag:

lsb_release -d

Output response:

Description:    Ubuntu 24.04 LTS

Method 2: Querying /etc/os-release (Best for Automation & Scripting)

For operations involving shell scripting, parsing utility blocks, or configuration pipelines, checking standard configuration files is more optimal than parsing command output. The /etc/os-release file stores system configuration parameters using structured environment variables.

Inspect the file contents via the standard cat utility:

cat /etc/os-release

Example terminal output response:

NAME=”Ubuntu”
VERSION=”24.04 LTS (Noble Numbat)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=”Ubuntu 24.04 LTS”
VERSION_ID=”24.04″
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”
VERSION_CODENAME=noble
UBUNTU_CODENAME=noble

To programmatically isolate a single property inside an automation script, filter the file utilizing the grep matching engine:

grep "VERSION_ID" /etc/os-release

Output response:

VERSION_ID=”24.04″

Method 3: Using hostnamectl (Comprehensive System Overview)

Distributions leveraging modern systemd process initialization architectures can make use of the hostnamectl command. This tool serves a dual role by returning the host’s networking naming schema alongside operational kernel variables.

Execute the controller tool directly:

hostnamectl

Example terminal output response:

  Static hostname: ubuntu-server
         Icon name: computer-vm
           Chassis: vm 🖥️
        Machine ID: a3dbbc591740443fb72da89f532f8312
           Boot ID: e9a2040bfa0d46ddba7ea589d3d024ee
    Virtualization: kvm
  Operating System: Ubuntu 24.04 LTS
            Kernel: Linux 6.8.0-31-generic
      Architecture: x86-64
   Hardware Vendor: QEMU
    Hardware Model: Standard PC

Operational Tip: This tracking interface is uniquely valuable for server environments since it returns hypervisor virtualization profiles (e.g., KVM, VMware) and kernel compile rings on a unified display.

Method 4: Reading /etc/issue (Quick Static Inspection)

The /etc/issue config file acts as a pre-login banner file containing basic identification text. Systems reference this text prior to initializing standard secure shell sessions or network login protocols.

cat /etc/issue

Output response:

Ubuntu 24.04 LTS \n \l

Note: The trailing escape parameters \n and \l represent console escape sequences mapping local network hostnames and terminal line connections during system initialization.

Method 5: Accessing System Information via GUI (Desktop Systems Only)

If you operate an interactive local user environment via the default GNOME interface, checking system versions requires no console interactions:

  1. Launch the primary Settings console panel.
  2. Navigate to the bottom index using the left navigation track and select System.
  3. Click on the About category block.
  4. Review your exact version string underneath the OS Name field label.

The graphical control interface provides a high-level summary of physical or allocated memory allocations, processor types, graphics components, and overall disk capacities.

Strategic Breakdown: Choosing the Right Approach

MethodPrimary Use CaseTarget EnvironmentData Granularity
lsb_release -aManual verificationDesktop / ServerHigh (Distribution-focused)
cat /etc/os-releaseAutomation scriptsAll Linux systemsHigh (Key-Value schema)
hostnamectlCloud infrastructure evaluationSystemd-managed serversComprehensive (OS + Kernel + Hypervisor)
cat /etc/issueMinimal baseline inspectionsBare-metal / ContainerMinimal (Text banner)
Graphical UIEnd-user diagnosticsDesktop environmentsModerate (Hardware paired)

Troubleshooting Common Environmental Edge Cases

Error: “lsb_release: command not found”

Minimalized baseline server images (often utilized across hyperscale cloud systems or lightweight templates) might omit formatting utilities to save footprint storage. To patch this, synchronize software indexes and fetch the original package manually:

sudo apt update && sudo apt install -y lsb-release

Verifying Host Version inside Container Deployments (Docker)

Container Scope Precaution: Executing diagnostic parameters within isolated runtime boundaries returns file metrics unique to the container’s virtual base image layer, rather than the core host system.

To inspect the underlying host kernel while embedded within a container environment, evaluate the standard system architecture mapping file using:

uname -a

Windows Subsystem for Linux (WSL) Behaviors

When running application blocks via the Windows Subsystem for Linux, standard formatting applies directly. Checking via standard configurations ensures compatibility with targeted operational configurations:

cat /etc/os-release

HAVE A QUESTION OR WANT TO GET A CUSTOM SOLUTION?

CONTACT SALES

FAQs

Run lsb_release -a in the terminal.

Yes. All methods in this guide work without root privileges.

cat /etc/os-release is usually preferred because the output is structured.

Yes. Ubuntu Desktop and Ubuntu Server use identical commands.

Run uname -r.

LTS releases receive long-term maintenance and security updates.

The package may not be installed on minimal images.

Yes, but it will show container operating system information rather than the host machine.

PRODUCTS THAT MIGHT INTEREST YOU:

Benefit from the best server plans and related services, competitive prices, coupled with personalized attention to each client. Supported by top-notch technical assistance that remains consistently accessible to address all your inquiries.