Linux: How to Check Your Ubuntu Version (and the Kernel Version Hiding Behind It)
You SSH into a server, run `uname -r`, see something like `5.15.0-105-generic`, and announce “we’re on Linux 5.15.” Then a teammate asks “but which *Ubuntu*?” and you realize that number told you nothing about your release. This is the trap hiding inside the simple task of checking your Linux Ubuntu version: a single box has two completely different “versions”, they update on separate schedules, and reading the wrong one is the most common mistake people make at the terminal.
This guide covers every reliable way to check your Ubuntu version on Linux, the distribution version *and* the kernel version, with real commands and real output. It’s part of our complete guide to managing Linux servers, and it’s written so you finish knowing not just the number, but which number the situation actually needs.
Key Takeaways
• For a clean Ubuntu version with codename, run `lsb_release -a`. It’s the friendliest single command.
• `cat /etc/os-release` works on every Linux distribution, not just Ubuntu, and is the most portable check.
• `hostnamectl` shows the OS *and* the kernel together in one screen.
• The distribution version (Ubuntu 22.04) and the kernel version (5.15.x) are separate things on separate schedules. `uname -r` shows the kernel, not Ubuntu.
• Ubuntu version numbers are `YY.MM`. Even-year April releases (20.04, 22.04, 24.04) are LTS with the longest support; odd numbers are short-lived interim releases.
What is the fastest way to check the Ubuntu version?
The single cleanest command is `lsb_release`:
“`bash lsb_release -a “`
Typical output on an Ubuntu server:
“`text No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy “`
That’s everything most people want: the release number (`22.04`), the point release (`.4`), the LTS flag, and the codename (`jammy`). If you only want the description line:
“`bash lsb_release -d “`
“`text Description: Ubuntu 22.04.4 LTS “`
One caveat: `lsb_release` lives in the `lsb-release` package, which is preinstalled on desktop Ubuntu but is sometimes *missing* from minimal cloud and container images. If you get `command not found`, don’t panic, you have a better, more universal option below.
How do I check the Ubuntu version on a minimal or container image?
Use the file that exists on essentially every modern Linux system:
“`bash cat /etc/os-release “`
“`text PRETTY_NAME=”Ubuntu 22.04.4 LTS” NAME=”Ubuntu” VERSION_ID=”22.04″ VERSION=”22.04.4 LTS (Jammy Jellyfish)” VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL=”https://www.ubuntu.com/” SUPPORT_URL=”https://help.ubuntu.com/” “`
This is the most reliable check because `/etc/os-release` is a freedesktop standard present on Ubuntu, Debian, AlmaLinux, Fedora, and the rest. It’s also machine-readable, every line is a shell-style `KEY=VALUE`, so you can source it directly in scripts:
“`bash
. /etc/os-release echo “$NAME $VERSION_ID ($VERSION_CODENAME)” “`
“`text Ubuntu 22.04 (jammy) “`
The `ID_LIKE=debian` line is a useful detail: it tells you Ubuntu is Debian-family, which is why `apt` and `.deb` packages work. If you’re weighing the two, see .
Two quicker, older files exist as well. `/etc/issue` is the login banner:
“`bash cat /etc/issue “`
“`text Ubuntu 22.04.4 LTS \n \l “`
(The `\n \l` are banner escape codes for hostname and terminal line, ignore them.) There’s also `/etc/lsb-release`, a plain file you can read even when the `lsb_release` *command* is absent:
“`bash cat /etc/lsb-release “`
“`text DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION=”Ubuntu 22.04.4 LTS” “`
How does hostnamectl show the version and kernel together?
`hostnamectl` is the one command that puts the operating system and the kernel side by side, which makes it perfect for the confusion this whole article is about:
“`bash hostnamectl “`
“`text Static hostname: web01 Icon name: computer-vm Chassis: vm Machine ID: 9f2c0b8a4d1e4f6c8a2b3c4d5e6f7a8b Boot ID: 1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d Virtualization: kvm Operating System: Ubuntu 22.04.4 LTS Kernel: Linux 5.15.0-105-generic Architecture: x86-64 “`
Look closely at those last lines. The Operating System is `Ubuntu 22.04.4 LTS`. The Kernel is `Linux 5.15.0-105-generic`. Two different version numbers, on the same machine, at the same time. That is not a glitch, and understanding why is the single most valuable thing in this guide.
Why does the kernel version look nothing like the Ubuntu version?
Here’s the question everyone eventually asks. You check your kernel and get a `5.15.x` or `6.8.x` number that has nothing in common with `22.04` or `24.04`. Both are correct. They measure different things.
“`bash uname -r # kernel release only “`
“`text 5.15.0-105-generic “`
“`bash uname -a # everything: kernel, hostname, build date, arch “`
“`text Linux web01 5.15.0-105-generic #115-Ubuntu SMP Mon Apr 15 09:52:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux “`
People conflate two genuinely different “versions” on one Linux box, and it causes real, repeated confusion. The OS/distribution version (Ubuntu 22.04) and the kernel version (5.15.x) are separate components that update on separate schedules. `uname -r` reports the kernel; `lsb_release -a` and `/etc/os-release` report the distribution, and they’re usually very different numbers, because Ubuntu ships kernel updates *within* a single release and can even offer a newer kernel (the Hardware Enablement, or HWE, stack) on the same Ubuntu version without changing the `22.04` you see in `os-release`. So “what version am I running?” has two correct answers, and which one you want depends on the job:
- For support and end-of-life dates, package compatibility, and “what release is this”, you want the distribution version, from `/etc/os-release` or `lsb_release -a`.
- For hardware support, driver questions, and security-patch level, you want the kernel version, from `uname -r`.
Knowing they’re independent, and which one the situation calls for, saves you from the classic mistake of reading a kernel number and thinking it’s your Ubuntu release. They march to different drummers: you can run `apt upgrade` on a Tuesday, jump from kernel `5.15.0-105` to `5.15.0-107`, and your Ubuntu version stays exactly `22.04` the whole time.
Here is the same split laid out as a quick reference:
| Command | What it shows | Example output | Use it for |
|---|---|---|---|
| `lsb_release -a` | Distribution version + codename | `Ubuntu 22.04.4 LTS / jammy` | Clean human-readable Ubuntu version |
| `cat /etc/os-release` | Distribution (all distros) | `VERSION_ID=”22.04″` | Portable / scriptable checks |
| `cat /etc/issue` | Login banner version | `Ubuntu 22.04.4 LTS` | Quick glance, pre-login |
| `hostnamectl` | OS and kernel together | `Ubuntu 22.04.4 / Linux 5.15.0-105` | Seeing both at once |
| `uname -r` | Kernel release | `5.15.0-105-generic` | Drivers, hardware, patch level |
| `uname -a` | Kernel + arch + build date | `Linux … 5.15.0-105 … x86_64` | Full kernel detail |
| `uname -m` | Machine architecture | `x86_64` | CPU architecture |
| `dpkg –print-architecture` | Debian package arch | `amd64` | Which `.deb` packages to install |
For more on what the kernel actually is and why it updates on its own cadence, see .
How do I check the architecture (32-bit, 64-bit, ARM)?
Architecture is a third “version-like” fact, and it matters when you download software or pick the right `.deb`. The kernel’s view:
“`bash uname -m “`
“`text x86_64 “`
`x86_64` means 64-bit Intel/AMD. You’ll see `aarch64` on 64-bit ARM (common on cloud ARM instances and Raspberry Pi), or `i686`/`i386` on legacy 32-bit systems. The package manager has its own naming, which is what you actually need when grabbing a `.deb`:
“`bash dpkg –print-architecture “`
“`text amd64 “`
Note the mismatch in vocabulary: the kernel calls it `x86_64`, while Debian/Ubuntu packaging calls the same thing `amd64`. Both are correct for the same 64-bit Intel/AMD machine, they’re just different naming conventions, which is yet another flavor of the “two correct answers” theme running through this whole topic. You’ll lean on these architecture checks constantly when installing software; for the broader toolkit, see .
What do the Ubuntu version numbers actually mean (LTS vs interim)?
Ubuntu’s version scheme is refreshingly literal: `YY.MM`, the two-digit year and two-digit month of release. Ubuntu ships on a fixed cadence, so the number is also a date:
“`text 22.04 → released April 2022 23.10 → released October 2023 24.04 → released April 2024 “`
The crucial distinction is LTS versus interim:
| Release type | Pattern | Cadence | Standard support |
|---|---|---|---|
| LTS (Long Term Support) | Even year, April (`.04`) | Every 2 years | 5 years free standard support |
| Interim | Any non-LTS (e.g. `.10`, odd years) | Every 6 months | 9 months |
So `20.04`, `22.04`, and `24.04` are LTS releases, the even-year April ones, and the right default for servers because they get five years of standard security maintenance. An interim release like `23.10` is great for getting newer software fast on a workstation, but its 9-month window means it goes end-of-life quickly. For a server, the codename and the LTS flag from `lsb_release -a` are the two facts that tell you how long you’re safe.
Why does my Ubuntu version actually matter?
Checking the version isn’t trivia, it drives three real decisions:
- Support and end-of-life (EOL). Once a release reaches EOL, it stops getting security updates. Running an EOL Ubuntu is running known-unpatched holes.
- Security updates. The version determines which patches reach you and how long. LTS releases keep flowing fixes for years; interim releases stop in months.
- Package compatibility. Each release ships a specific set of package versions. Software documented for `24.04` may simply not exist in `20.04`’s repositories, which is why `VERSION_ID` is the line install guides care about most.
How do I check if my Ubuntu release is still supported?
The fast, offline answer combines the version you already found with Ubuntu’s published support windows. To see the support state directly from the machine, the Ubuntu Pro client (preinstalled on recent releases) shows it:
“`bash pro status “`
“`text SERVICE ENTITLED STATUS DESCRIPTION esm-apps yes enabled Expanded Security Maintenance for Applications esm-infra yes enabled Expanded Security Maintenance for Infrastructure … “`
A practical EOL check that needs no extra tooling is to confirm your release is an LTS and read its `VERSION_ID`, then compare against Ubuntu’s release schedule. As a quick gut check: if `lsb_release -d` does not say `LTS`, treat the box as short-lived and plan an upgrade. If it does say LTS, you have years, but never assume; verify against the official schedule linked at the end of this article.
When you do need to move up, the upgrade path is the `do-release-upgrade` tool, but always check the version *first*, take a backup, and read the release notes for your target. Stable, well-supported releases are exactly why most production servers stick to LTS.
Run the Ubuntu version you actually choose, on infrastructure built for it. DarazHost Linux SSD VPS and dedicated servers let you pick your Ubuntu, Debian, or AlmaLinux version with full root access, so you can check, manage, and update both your distribution *and* your kernel exactly how your workload needs. It’s the controllable Linux environment with your choice of release and 24/7 support, the difference between guessing what version you’re stuck with and deciding it yourself. When you control root, “what version am I running?” is always a choice, not a surprise.
Once you can read both numbers fluently, the whole picture clicks: `os-release` and `lsb_release` answer “which Ubuntu,” `uname -r` answers “which kernel,” and `hostnamectl` shows you both at a glance. The skill isn’t memorizing one magic command, it’s knowing which version the question in front of you is really asking about. Managing those systems day to day, across users, updates, and remote access, is the subject of the complete Linux server administration guide. When you connect over the network to run these checks, do it safely with .
Frequently asked questions
Is the kernel version the same as the Ubuntu version? No, and this is the most common mix-up. `uname -r` (e.g. `5.15.0-105-generic`) is the kernel; `lsb_release -a` or `/etc/os-release` (e.g. `Ubuntu 22.04`) is the distribution. Ubuntu updates the kernel *within* a release, so a single `22.04` install will see many kernel numbers over its life while staying `22.04`.
`lsb_release` says “command not found”, what now? That command isn’t installed on some minimal, cloud, and container images. Use `cat /etc/os-release` instead, it’s standard on every distribution and always present. You can also install the command with `sudo apt install lsb-release` if you prefer it.
Which command works on any Linux distribution, not just Ubuntu? `cat /etc/os-release`. It’s a freedesktop standard found on Debian, AlmaLinux, Fedora, openSUSE, and more, with consistent fields like `NAME`, `VERSION_ID`, and `PRETTY_NAME` you can read or source in scripts.
Why does `dpkg –print-architecture` say `amd64` when `uname -m` says `x86_64`? They describe the same 64-bit Intel/AMD hardware with different naming conventions. The kernel uses `x86_64`; Debian/Ubuntu packaging uses `amd64`. Use the `dpkg` name when choosing which `.deb` to install.
How do I know if my Ubuntu release is still getting security updates? Check whether it’s an LTS (`lsb_release -d` should include `LTS`) and verify its `VERSION_ID` against Ubuntu’s release schedule. LTS releases get five years of standard support; interim releases get nine months. Run `pro status` on recent releases to see live support state.
The bottom line: “what version is my Linux box running” is two questions wearing one coat. Pull the distribution version from `/etc/os-release` or `lsb_release -a` for support and package decisions, pull the kernel version from `uname -r` for hardware and patch questions, and use `hostnamectl` when you want to see both at once. Know which one the task needs, and you’ll never again mistake a kernel number for your Ubuntu release.