How to Check Your Ubuntu Version

By 

Updated on

4 min read

Terminal commands used to check the Ubuntu version

Knowing which Ubuntu version is running on your system helps you install the right packages, follow version-specific documentation, and apply the correct security patches.

Ubuntu publishes a new release every six months. LTS (Long Term Support) releases come out every two years and receive security updates for five years. Ubuntu Pro can extend coverage to ten years, and Canonical offers longer coverage with the Legacy add-on. Interim releases are supported for nine months.

This guide covers several ways to check your Ubuntu version from the command line.

Quick Reference

MethodCommand
Recommendedcat /etc/os-release
Distribution summarylsb_release -d
One-line bannercat /etc/issue
Hostname and OS infohostnamectl
Kernel versionuname -r

Using lsb_release

The lsb_release command displays Linux Standard Base (LSB) information about the distribution. It is available by default on most Ubuntu desktop installations.

To display full release information:

Terminal
lsb_release -a
output
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.2 LTS
Release:	24.04
Codename:	noble

The version is shown in the Description line. To display only the description:

Terminal
lsb_release -d
output
Description:	Ubuntu 24.04.2 LTS
Info
If lsb_release is not available (common on minimal server installs), install it with sudo apt install lsb-release, or use /etc/os-release instead.

Using /etc/os-release

The /etc/os-release file contains operating system identification data in a key-value format. It is present on every supported Ubuntu release and does not require any additional packages:

Terminal
cat /etc/os-release
output
PRETTY_NAME="Ubuntu 24.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.2 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

To extract only the version string, use grep :

Terminal
grep PRETTY_NAME /etc/os-release
output
PRETTY_NAME="Ubuntu 24.04.2 LTS"

Using /etc/issue

The /etc/issue file contains a short system identification banner. Use the cat command to display it:

Terminal
cat /etc/issue
output
Ubuntu 24.04.2 LTS \n \l

The \n and \l tokens are placeholders for the hostname and terminal line. They are replaced with actual values on the login screen.

Using hostnamectl

The hostnamectl command displays the hostname and other system information, including the operating system version:

Terminal
hostnamectl
output
 Static hostname: ubuntu
       Icon name: computer-vm
         Chassis: vm 🖴
      Machine ID: a92099e30f704d559adb18ebc12ddac4
         Boot ID: 4224ba0d5fc7489e95d0bbc7ffdaf709
  Virtualization: qemu
Operating System: Ubuntu 24.04.2 LTS
          Kernel: Linux 6.8.0-51-generic
    Architecture: x86-64

The Ubuntu version is shown on the “Operating System” line.

Using uname

The uname command does not show the Ubuntu version directly. It only displays the kernel version, so use it for kernel details rather than release identification:

Terminal
uname -r
output
6.8.0-51-generic

To see all system information:

Terminal
uname -a

Checking from the Desktop

If you are running Ubuntu with the default GNOME desktop, open Settings and scroll down to the About section (or System > About on Ubuntu 24.04). The Ubuntu version and hardware details are displayed there.

Ubuntu Version History

VersionCodenameRelease DateStatus
Ubuntu 24.04Noble NumbatApril 2024Current LTS
Ubuntu 23.10Mantic MinotaurOctober 2023End of life
Ubuntu 22.04Jammy JellyfishApril 2022LTS, standard support until 2027
Ubuntu 20.04Focal FossaApril 2020Standard support ended, Ubuntu Pro available
Ubuntu 18.04Bionic BeaverApril 2018Standard support ended

Troubleshooting

lsb_release: command not found
The lsb-release package is not installed. This is common on minimal or server installations. Install it with sudo apt install lsb-release, or use /etc/os-release instead.

Different commands show different versions
This can happen after a partial upgrade. Run sudo apt update && sudo apt full-upgrade to complete the upgrade, then check again.

FAQ

How do I check if my Ubuntu is 32-bit or 64-bit?
Run dpkg --print-architecture. It returns amd64 for 64-bit or i386 for 32-bit.

What is the difference between LTS and interim releases?
LTS releases come out every two years and are supported for five years. Ubuntu Pro can extend coverage to ten years, while interim releases come out every six months and are supported for nine months.

How do I check which kernel my Ubuntu is running?
Run uname -r to display the kernel version. The kernel version does not always match the Ubuntu release number.

How do I upgrade to a newer Ubuntu version?
Run sudo do-release-upgrade. On desktop systems, the Software Updater will also prompt you when a new release is available. Always back up your system before upgrading.

Conclusion

You can check your Ubuntu version using /etc/os-release, lsb_release -d, /etc/issue, or hostnamectl. For most systems, cat /etc/os-release is the most reliable method since it requires no extra packages. If you also manage Debian servers, the same methods apply there with minor differences.

Tags

Linuxize Weekly Newsletter

A quick weekly roundup of new tutorials, news, and tips.

About the authors

Dejan Panovski

Dejan Panovski

Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page