How to Check Ubuntu Version in Terminal

The Architecture Validation Vector

When inheriting administration of a headless Ubuntu server, or preparing to deploy enterprise software that demands strict dependency requirements (e.g., a database that specifically requires Ubuntu 22.04 LTS and will crash on 20.04), blindly executing installation commands is a catastrophic risk. You must mathematically verify the exact kernel architecture and OS release version currently running on the silicon before proceeding. You must interrogate the master Linux configuration files to extract this telemetry.

How to Check Ubuntu Version in Terminal

Ubuntu provides multiple command-line utilities to query the operating system identity, ranging from simple release numbers to deep kernel architecture data.

1. Open your terminal application or connect to the server via SSH.
2. Method 1: The Master Release Query (`lsb_release`):
* The Linux Standard Base (`lsb`) utility is the most efficient and readable method to extract the specific Ubuntu version number and codename.
* Type exactly:
lsb_release -a
* Press Enter.
* The terminal will output a clean matrix. The Description line provides the human-readable string (e.g., `Ubuntu 22.04.3 LTS`), and the Release line outputs the strict numerical version (e.g., `22.04`).
3. Method 2: The Raw Configuration Interrogation (`/etc/os-release`):
* If the `lsb_release` utility is missing or corrupted, you must manually parse the core operating system identification file.
* Use the `cat` command to output the contents of the file directly to the terminal.
* Type exactly:
cat /etc/os-release
* Press Enter.
* This outputs the raw variable data the system uses for identification. Look specifically for the lines beginning with VERSION= and PRETTY_NAME=.
4. Method 3: The Deep Kernel Interrogation (`uname`):
* The previous commands confirm you are running Ubuntu 22.04, but they do not detail the specific Linux kernel version or the hardware architecture (e.g., 64-bit x86 vs. ARM).
* To extract this critical hardware-level telemetry, use the Unix Name utility with the ‘all’ flag.
* Type exactly:
uname -a
* Press Enter.
* The terminal will output a dense string. It will confirm the architecture (e.g., `x86_64` for standard 64-bit Intel/AMD chips, or `aarch64` for ARM chips like AWS Graviton) and the exact kernel version (e.g., `5.15.0-89-generic`). This data is mandatory when compiling custom software.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.