Skip to content

Linux basicsFor beginnersDuration around 2 min.

How to check your Ubuntu version, codename and kernel

A single command in the terminal shows which Ubuntu version is running on a server. Here are the common ways with their output — for the version with point release, the codename, the kernel and the architecture.

Tested on with Ubuntu 24.04 LTS and Ubuntu 26.04 LTS

At a glance

  • lsb_release -a states the version, point release and codename, such as Ubuntu 24.04.5 LTS and noble.
  • The /etc/os-release file is available on every Ubuntu system, even in minimal images and containers.
  • The kernel is not part of the Ubuntu version: uname -r shows it separately.

With lsb_release

The most common way. Release is the version, Description additionally states the point release, Codename the name that package repositories also use.

Show version
lsb_release -a
Output on Ubuntu 24.04
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.5 LTS
Release:	24.04
Codename:	noble

If the command is missing in a minimal image, install the package with sudo apt install lsb-release or use the next method.

With /etc/os-release

This file exists on every Ubuntu system, without an additional package. It is also the source from which scripts read the version.

Output file
cat /etc/os-release
Output on Ubuntu 26.04 (excerpt)
PRETTY_NAME="Ubuntu 26.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="26.04"
VERSION="26.04.1 LTS (Resolute Raccoon)"
VERSION_CODENAME=resolute
ID=ubuntu
ID_LIKE=debian

Output only one line

For scripts or a quick glance, one line is often enough — the description, the codename or the version number:

Short forms
lsb_release -ds
lsb_release -cs
grep -E '^(PRETTY_NAME|VERSION_ID)=' /etc/os-release

In a shell script, the cleanest way to read the values is by reading the file:

Version in the script
. /etc/os-release
echo "$VERSION_ID"
echo "$VERSION_CODENAME"

With hostnamectl

hostnamectl shows the operating system, kernel and architecture at a glance, alongside the hostname. It requires systemd and is therefore available on servers, but not in containers.

System overview
hostnamectl

Kernel and architecture

The kernel version changes with updates without the Ubuntu version changing. The architecture determines which packages and images fit — x86_64 is called amd64 in package repositories, aarch64 is called arm64.

Kernel and architecture
uname -r
uname -m
dpkg --print-architecture

What the version number means

  • The number is the year and month of release: 24.04 was released in April 2024, 26.04 in April 2026.
  • LTS versions are released every two years in April and receive security updates for five years; the versions in between are maintained for nine months.
  • The third number (24.04.5) is the point release: an updated installation image of the same version, not a new version.
  • For VPS, Cloud Server and dedicated servers from ENTRONYX CLOUD, Ubuntu 24.04 LTS and 26.04 LTS are available as an image — the overview is available under VPS Hosting.

Typical errors

  • “lsb_release: command not found”: The package is missing, typical in minimal images and containers. Install lsb-release or read /etc/os-release.
  • hostnamectl is missing or reports an error: No systemd is running in a container. Use /etc/os-release there.
  • The kernel version does not match the Ubuntu version: In a container, uname -r shows the host's kernel, not the container's.

We tested all commands in this guide on 2 December 2026 — with Ubuntu 24.04 LTS and Ubuntu 26.04 LTS. If a step changes at the manufacturer, we update it here along with the date.

Official documentation

Frequently asked questions about the Ubuntu version

Which command do I use to show the Ubuntu version?

The fastest way is with lsb_release -a in the terminal. Without an additional package, cat /etc/os-release works on every Ubuntu system, even in containers.

How do I know if my version is LTS?

The description then bears the suffix LTS, such as Ubuntu 24.04.5 LTS. LTS versions are released every two years in April.

What do I need the codename for?

Package repositories name their branches after the codename, such as noble for 24.04 and resolute for 26.04. If you add a third-party package repository, you need the correct name.

Is the kernel version the same as the Ubuntu version?

No. Ubuntu ships multiple kernels sequentially for a single version; uname -r shows the running one, while the Ubuntu version remains the same.

Where can I see the version without a terminal?

On a desktop with Ubuntu, it is in the settings under “System” and then “About”. On a server without a graphical interface, the terminal remains the only option, even via SSH.

Further reading

More tutorials

  • The scp command with examples: copy files over SSH

    Linux basicsFor beginnersabout 5 min

    scp copies files over an SSH connection — encrypted, with the same credentials as your login, and without an additional service on the server. This guide shows the commands for common use cases, each with an example to copy.

  • How to remove a directory in Linux with rm and rmdir

    Linux basicsFor beginnersabout 5 min

    In Linux, you delete an empty folder with rmdir and a folder including its contents with rm -r. This tutorial shows both commands with their messages, the variants with and without prompting, and what to check before running rm -rf — because there is no recycle bin in the terminal.

  • How to update Ubuntu and upgrade to the next LTS release

    Linux basicsFor beginnersabout 15 min

    A server only stays secure if it receives its updates. This guide shows the three stages: applying updates manually, running security updates automatically and switching to the next LTS release.

Ubuntu 24.04 LTS and 26.04 LTS

For VPS, Cloud Servers and dedicated servers, both LTS versions are available as an image at no extra charge.