How to Check Ubuntu Version

The Kernel Interrogation Vector

When attempting to compile complex software from source code or adding third-party cryptographic repositories to the `apt` package manager, knowing you are running “Ubuntu” is mathematically insufficient. The underlying architecture changes drastically between iterative releases (e.g., 20.04 LTS Focal Fossa vs. 22.04 LTS Jammy Jellyfish). Installing a `.deb` package engineered for a newer kernel onto an older distribution will cause catastrophic dependency failures. You must instruct the Linux kernel to explicitly output its master release data and architectural strings.

How to Check Ubuntu Version

The Ubuntu terminal provides several native execution pathways to extract this telemetry, ranging from simple release files to deep kernel interrogation utilities.

1. Open your terminal application or connect to the server via SSH.
2. Method 1: The Master OS Release File (The Recommended Protocol):
* The absolute fastest and most reliable method is to instruct the terminal to read the contents of the `/etc/os-release` file. This file contains the standardized identification data for the distribution.
* Type exactly:
cat /etc/os-release
* Press Enter.
* Parsing the Data: The kernel will output a dense block of text. Look for the line explicitly labelled PRETTY_NAME (e.g., `PRETTY_NAME=”Ubuntu 22.04.3 LTS”`). This gives you the human-readable version. The VERSION_ID (e.g., `”22.04″`) and VERSION_CODENAME (e.g., `jammy`) are critical for scripting and repository management.
3. Method 2: The Local System Information Command (`lsb_release`):
* The Linux Standard Base (LSB) utility is designed specifically to output distribution-specific information in a clean, parsable format.
* Type exactly:
lsb_release -a
* Press Enter.
* Parsing the Data: The output is stripped of excess variables. You will see four clear lines: Distributor ID, Description (e.g., `Ubuntu 22.04.3 LTS`), Release (e.g., `22.04`), and Codename.
4. Method 3: The Deep Kernel Interrogation (`hostnamectl`):
* If you are running a modern systemd-based Ubuntu environment and need to verify not just the OS version, but the underlying machine ID, kernel version, and virtualization architecture.
* Type exactly:
hostnamectl
* Press Enter.
* This outputs a comprehensive diagnostic matrix, including the “Operating System” string (e.g., `Ubuntu 20.04.6 LTS`) and the highly specific “Kernel” string (e.g., `Linux 5.4.0-162-generic`), which is vital for debugging driver failures.

Get the best tech tips delivered straight to your inbox.

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