The Quick Answer: lsb_release
lsb_release -aThe output has four lines: Distributor ID (Ubuntu), Description (the full name with the point release and LTS), Release (the number, such as 24.04), and Codename (such as noble). On some releases a line saying that no LSB modules are available comes first; it is harmless.
For one value only, use the short options: lsb_ prints the release number, lsb_ the codename. If the command is missing on a minimal image, install it with sudo apt install lsb-release, or use the file below, which is always there.
The File That Is Always There
cat /etc/os-releaseThis file exists on every current Linux distribution. The lines that matter:
| Line | Meaning |
|---|---|
PRETTY_ | Full name with point release |
VERSION_ | Release number, such as 24.04 |
VERSION_ | Codename, such as noble |
ID | Distribution, here ubuntu |
In a shell script, load the file and read the variables directly:
. /etc/os-release
echo "$ID $VERSION_ID"hostnamectl
hostnamectlBesides the host name, it shows the Operating System line with the full Ubuntu name and the Kernel line with the running kernel. It is handy when you want the system, the kernel, and the virtualization type on one screen.
/etc/issue
cat /etc/issueThis is the text shown before a console login. It normally contains the Ubuntu name and point release, but an administrator can change it, so treat it as a hint rather than the source of truth.
The same commands work on Debian: /etc/os-release and hostnamectl are always available there, and lsb_ needs the lsb-release package. Debian also has /etc/debian_. The differences between the two systems are in Debian vs Ubuntu Server.
How to Read the Number
- Year and month: 24.04 was released in April 2024. Every Ubuntu release is numbered this way.
- Point release: 24.04.1, 24.04.2, and so on are the same release with collected updates. A server kept up to date with apt moves through them on its own.
- LTS: the April release of every even year is a long-term support release, such as 22.04, 24.04, and 26.04.
LTS and Interim Releases
LTS releases get five years of standard security maintenance. The releases in between, numbered .10 or the April release of an odd year, are interim releases with nine months of support. For a server, choose an LTS release; an interim release has to be upgraded every few months to stay supported.
Codenames
| Release | Codename |
|---|---|
| 22.04 LTS | jammy (Jammy Jellyfish) |
| 24.04 LTS | noble (Noble Numbat) |
| 26.04 LTS | resolute (Resolute Raccoon) |
The short lowercase codename appears in apt sources and in many installation instructions, which is why lsb_ is used in so many scripts.
The Kernel Is Not the Ubuntu Version
uname -r prints the Linux kernel version, a number such as 6.8 on 24.04 or 7.0 on 26.04, followed by a build number. It tells you nothing direct about the Ubuntu release, and a release can move to a newer kernel during its life. See how to check the kernel version.
Is a Newer Release Available?
do-release-upgrade -cThis only checks whether a newer release is available; it changes nothing. Take a snapshot before an actual release upgrade; snapshot vs backup explains which one you need.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations