How to Check Version of Ubuntu

The Kernel Identity Audit Vector

When operating a bare-metal Ubuntu Linux server architecture, knowing the exact integer version of your deployment is a critical pre-requisite before executing any structural modifications. The Advanced Packaging Tool (APT) maps its repository fetches directly to the specific release code (e.g., `jammy` for 22.04 LTS, `focal` for 20.04 LTS). If you attempt to forcefully inject a PPA (Personal Package Archive) engineered for an obsolete architecture, or if you try to compile a complex C++ daemon against the wrong kernel headers, the OS will mathematically fail, throwing catastrophic dependency errors. You must instruct the core UNIX kernel to execute a deep registry read, querying the localized `/etc` release files and dumping the absolute, mathematically verified OS version string to the terminal.

How to Check Version of Ubuntu

The Linux command-line provides multiple binaries to execute this extraction, ranging from the modernized `lsb_release` daemon to a raw string extraction (`cat`) from the core OS identification files.

1. Open your terminal application or connect to the headless server via SSH.
2. Method 1: The LSB Release Daemon (The Optimal Vector):
* The Linux Standard Base (LSB) command is the mathematically superior pathway, engineered specifically to parse the release data into a highly readable, structured matrix.
* Syntax: lsb_release -a (The `-a` flag forces a dump of all associated strings).
* Type exactly:
lsb_release -a
* Press Enter.
* The Output Matrix: The daemon spits back four distinct variables: `Distributor ID`, `Description`, `Release`, and `Codename`. Look at the Description: line (e.g., `Ubuntu 22.04.4 LTS`). This is your absolute, undeniable architectural version.
3. Method 2: The Raw File Extraction (The `/etc/os-release` Vector):
* If you are operating within a highly stripped-down Docker container or a minimalist server build where the `lsb_release` binary has been intentionally deleted, you must query the raw file system.
* Syntax: cat /etc/os-release
* Type exactly:
cat /etc/os-release
* Press Enter.
* The Output Matrix: The `cat` binary violently dumps the raw text contents of the file directly to your terminal. Scan the output for the line explicitly labelled PRETTY_NAME="Ubuntu 22.04 LTS" or check the raw VERSION_ID="22.04" string.
4. Method 3: The Kernel-Level Audit (The `uname` Vector):
* If you do not care about the “Ubuntu” marketing name but demand to know the exact numerical version of the core Linux kernel currently loaded into RAM (essential for compiling hardware drivers).
* Type exactly: uname -r
* Press Enter. The OS will return a string like `5.15.0-101-generic`.

Get the best tech tips delivered straight to your inbox.

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