How to Check Your Ubuntu OS Version (Every Method Explained)
Knowing which version of Ubuntu you're running isn't just trivia — it directly affects software compatibility, security patch eligibility, and whether certain terminal commands or GUI options will even exist on your system. Ubuntu releases follow a predictable naming and numbering pattern, but the way you retrieve that version information varies depending on your setup, access level, and whether you're working on a desktop or a headless server.
Here's a complete breakdown of every reliable method, what each one tells you, and why the results can differ depending on your environment.
Why Ubuntu Version Checking Isn't Always Straightforward
Ubuntu uses a YY.MM versioning format — so 22.04 means April 2022, and 24.04 means April 2024. Releases come in two flavors:
- LTS (Long-Term Support): Supported for 5 years, used heavily in production environments
- Standard releases: Supported for only 9 months, more cutting-edge but shorter lifespan
When you check your version, you might see references to the release number, the codename (like "Jammy Jellyfish" or "Noble Numbat"), and the kernel version — these are three distinct pieces of information, and they're not interchangeable.
Method 1: Using the Terminal (Most Reliable) 🖥️
The terminal works across every Ubuntu environment — desktop, server, WSL, or SSH session.
lsb_release -a
lsb_release -a This returns a full readout including:
| Field | Example Output |
|---|---|
| Distributor ID | Ubuntu |
| Description | Ubuntu 22.04.3 LTS |
| Release | 22.04 |
| Codename | jammy |
This is the most commonly recommended command because it's explicit and consistent across Ubuntu versions going back many years.
/etc/os-release
cat /etc/os-release This reads a standard configuration file that most Linux distributions maintain. It outputs variables like NAME, VERSION, VERSION_ID, and PRETTY_NAME. It's particularly useful in shell scripts where you need to parse the version programmatically.
hostnamectl
hostnamectl This command shows operating system info alongside hostname and kernel details — handy when you need everything at once. It's available on systems using systemd, which covers all modern Ubuntu releases (16.04 and later).
Checking the Kernel Version Separately
uname -r This returns your kernel version, not the Ubuntu release version. These are related but not the same. A system running Ubuntu 20.04 LTS may have a newer kernel installed via Hardware Enablement (HWE) stacks. Conflating kernel version with Ubuntu version is a common source of confusion.
Method 2: Through the Desktop GUI
If you're running a Ubuntu Desktop environment (GNOME-based in modern releases), you don't need a terminal at all.
Ubuntu 20.04 and later:
- Open Settings
- Scroll to About at the bottom of the sidebar
- The OS version appears under "OS Name" or "Operating System"
Ubuntu 18.04:
- Go to System Settings → Details
- Version information is listed on the Overview tab
The GUI method shows the clean release name and build number, which is sufficient for most everyday purposes. It won't show codename or kernel details without additional digging.
Method 3: Checking Version Inside WSL or a Container 🐧
If you're running Ubuntu inside Windows Subsystem for Linux (WSL), a Docker container, or a virtual machine, the same terminal commands apply — but the version you see reflects the Ubuntu image installed in that environment, not your host OS.
For WSL users, you can also check from the Windows side:
wsl --list --verbose This shows which WSL distributions are installed and their running state, but for the actual Ubuntu version inside WSL, you'll still need to run lsb_release -a from within the WSL terminal.
In Docker containers running Ubuntu base images, the /etc/os-release file is the most dependable method, since some minimal images strip out utilities like lsb_release to reduce image size.
Method 4: Checking for Available Updates as a Version Signal
Running:
sudo apt update && sudo apt list --upgradable ...won't directly tell you your version, but checking:
sudo do-release-upgrade --check-dist-upgrade-only ...will tell you whether a newer Ubuntu release is available relative to what you're currently running. This is useful for understanding where your current version sits in the upgrade path.
What the Version Number Actually Tells You
| Version Type | What It Means |
|---|---|
| 22.04 LTS | April 2022 release, 5-year support window |
| 23.10 | October 2023, standard release, 9-month support |
| Point release (22.04.3) | Third update to the 22.04 base, includes cumulative patches |
| Kernel version | The Linux kernel running under Ubuntu — can be newer than the base release suggests |
Understanding the point release number matters for support and compatibility. Some software packages specify minimum point releases, and security advisories are often tied to specific point release ranges.
Variables That Affect Which Method Works for You
Not every method is available in every scenario. A few factors determine what you can actually use:
- Desktop vs. server install: GUI methods aren't available on server or minimal installs
- Minimal or stripped environments: Some Docker images and cloud instances remove
lsb_releaseto save space —/etc/os-releaseis the fallback - Access level: Some commands require a terminal login; read-only or restricted shell environments may limit your options
- WSL version: WSL 1 and WSL 2 behave differently in some edge cases, though version-checking commands themselves work the same
- Custom Ubuntu derivatives: Lubuntu, Xubuntu, and Ubuntu Studio share the Ubuntu base version but may display information differently in their respective GUIs
A server admin SSHing into a production machine, a developer running Ubuntu in a Docker container, and a home user clicking through desktop settings are all "checking their Ubuntu version" — but the right tool for each scenario is genuinely different, and what the version number means for next steps depends entirely on what they're trying to do with that information.