How to Check Ubuntu Version

Last updated Tuesday, March 10, 2026 4:24 pm Joshua James 5 min read

Package guides, release upgrades, and repository instructions make a lot more sense once you know whether the machine is running jammy, noble, or resolute. To check Ubuntu version quickly, start with the built-in terminal commands below. They work on Ubuntu Desktop, headless servers, cloud VMs, and Ubuntu running inside WSL.

This walkthrough covers the fastest interactive command, a fallback that works well on minimal images, a broader system summary from hostnamectl, and the graphical Settings path for desktop users. None of these checks need sudo.

These methods were verified on Ubuntu 26.04 LTS, 24.04 LTS, and 22.04 LTS. The terminal commands behave the same on Ubuntu Desktop, Ubuntu Server, and Ubuntu on WSL. Only the graphical Settings method requires a full desktop session.

Check Ubuntu Version in the Terminal with lsb_release

For most interactive Ubuntu sessions, lsb_release -a is the cleanest command to check Ubuntu version because it prints the release and codename in one readable block.

lsb_release -a

The lines that matter look like this:

Release:	26.04
Codename:	resolute

If you also want the descriptive release name, read the Description line in the full output. On some Ubuntu 22.04 systems, lsb_release -a starts with No LSB modules are available.. That line is informational and the release data below it is still correct.

Print Only the Ubuntu Version Number or Codename

If a guide only asks for the release number or codename, narrower lsb_release flags keep the output short:

lsb_release -r
lsb_release -c
Release:	26.04
Codename:	resolute

Check Ubuntu Version from /etc/os-release

The /etc/os-release file is present on every normal Ubuntu install, which makes it especially useful on stripped-down server images, cloud instances, containers, and Ubuntu on WSL. Grep out the fields you care about:

grep -E '^(VERSION_ID|VERSION_CODENAME)=' /etc/os-release
VERSION_ID="26.04"
VERSION_CODENAME=resolute

This is the most reliable copy-and-paste option when you only need exact release fields for a repository, support matrix, or script. If you want the full operating system record instead, run cat /etc/os-release.

Check Ubuntu Version with hostnamectl

Use hostnamectl when you want more than the Ubuntu release. It shows the operating system, kernel, architecture, and virtualization details in one command, which is handy on workstations, lab VMs, and remote servers.

hostnamectl

For example, on Ubuntu 24.04 LTS the key lines look like this:

Operating System: Ubuntu 24.04.4 LTS
Kernel: Linux 6.17.0-14-generic
Architecture: x86-64

Ubuntu 26.04 and 22.04 show their own release names and kernel versions, but the same fields appear in the same place. On WSL, prefer lsb_release or /etc/os-release because they report the Ubuntu user space directly and with less noise.

Check Ubuntu Version on WSL and Ubuntu Server

The same Ubuntu commands work across desktop installs, headless servers, and WSL sessions. The main difference is where you run them.

Check Ubuntu Version in WSL

Open the Ubuntu shell itself, then run lsb_release -a or read /etc/os-release there. Those commands report the Ubuntu release inside WSL, not the Windows host version. If you manage several WSL distributions, PowerShell can help you pick the right one first, but the Ubuntu release number still comes from inside the Ubuntu environment.

Check Ubuntu Version on a Headless Server or Cloud VM

Once you are logged in over SSH, the commands stay the same. On lean server images, /etc/os-release is usually the safest first check because it is always available and does not depend on extra helper packages. After you confirm the release, keep the system current with our guide to update packages via Ubuntu command line or automate security patches with configure unattended upgrades on Ubuntu.

Check Ubuntu Version from the Desktop Settings App

If you are already in a graphical Ubuntu Desktop session, the Settings app can confirm the release without opening a terminal.

  1. Open Settings.
  2. Select System in the sidebar.
  3. Open About.
  4. Read the Ubuntu release shown in the operating system details.
Ubuntu Settings About page showing the operating system details and system information
The About page in Ubuntu Settings shows the installed Ubuntu release and basic system details.

This path is desktop-only. It does not apply to headless Ubuntu Server installs, most cloud images, or standard terminal-only WSL sessions.

Choose the Right Ubuntu Version Check Method

Each method answers a slightly different need. Use the table below to pick the quickest one for your environment.

MethodBest ForWhat It ShowsEnvironment Fit
lsb_release -aReadable terminal output on most Ubuntu systemsRelease, codename, and descriptive release nameDesktop, server, and WSL when the utility is installed
grep -E '^(VERSION_ID|VERSION_CODENAME)=' /etc/os-releaseMinimal images, scripts, SSH sessions, and WSLExact release number and codename fieldsBest all-around fallback for server and WSL
hostnamectlSystem summaries and troubleshootingOperating system, kernel, architecture, and virtualizationFull desktop or server installs with systemd
Settings > System > AboutDesktop users who prefer a graphical pathUbuntu release in the Settings appDesktop only

Ubuntu Version FAQ

Which command works best on WSL or a headless Ubuntu Server?

Use lsb_release -a if you want a readable summary, or read /etc/os-release if you want the most dependable option on stripped-down images. Both commands run without sudo and work inside Ubuntu on WSL as well as on normal Ubuntu Server installs.

Does PowerShell show the Ubuntu release inside WSL?

PowerShell can show which WSL distributions are registered and running, but the Ubuntu release itself still comes from inside the Ubuntu shell. Open the Ubuntu session and run lsb_release -a or check /etc/os-release there to see whether it is Ubuntu 26.04, 24.04, 22.04, or another release.

What is the difference between an Ubuntu version and a codename?

The version is the numbered release such as 26.04, 24.04, or 22.04. The codename is the matching release label such as resolute, noble, or jammy. Repository files and package instructions often use the codename, while support tables and upgrade guides usually lead with the version number.

Why does lsb_release print No LSB modules are available on Ubuntu 22.04?

On some Ubuntu 22.04 systems, lsb_release prints that informational line before the real release data. You can ignore it and read the Release and Codename lines below, or switch to /etc/os-release if you want cleaner script-friendly output.

Conclusion

Ubuntu version and codename are now easy to confirm from the terminal, over SSH, or inside WSL, and the Settings app covers the graphical path on desktop installs. If the machine is due for maintenance next, update packages via Ubuntu command line or configure unattended upgrades on Ubuntu so the release you just identified stays patched.

Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffee Buy me a coffee

Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Leave a Comment

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: