How to Check the Version of Ubuntu

Suraj Joshi Feb 02, 2024
  1. Check Ubuntu Version Using the lsb_release Command
  2. Check Ubuntu Version Using the /etc/issue File
  3. Check Ubuntu Version Using the /etc/os-release File
  4. Check Ubuntu Version Using the hostnamectl Command
  5. Check Ubuntu Version Using the Gnome
How to Check the Version of Ubuntu

We can check the version of Ubuntu installed in our system using the terminal with the lsb-release and hostnamectl commands. We can also check the etc files to know Ubuntu’s version, and it can also found through the Gnome.

There are various ways to check the version of Ubuntu using the command line. Some of them are:

Check Ubuntu Version Using the lsb_release Command

This method works for any version of Ubuntu. The lsb_release command-line utility displays Linux Standard Base (LSB) information about the Linux distribution.

We use the lsb_release -a command to display information about Ubuntu installed in our system.

lsb_release -a

Output:

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.4 LTS
Release:	18.04
Codename:	bionic

It will print information about the installed Ubuntu in our system.

From the description, it is clear that the version of Ubuntu installed in our system is 18.04.4 LTS.

If we want only the version of Ubuntu, we can just use lsb_release -d command to display only the description line.

lsb_release -d

Output:

Description:	Ubuntu 18.04.4 LTS

Check Ubuntu Version Using the /etc/issue File

The /etc/issue file contains system identification details of the Ubuntu. The contents of the file can be displayed using the cat command.

cat /etc/issue

Output:

Ubuntu 18.04.4 LTS \n \l

It shows the version of the installed Ubuntu is 18.04.4, and LTS represents Long Term Support Version.

Check Ubuntu Version Using the /etc/os-release File

The /etc/os-release file contains details about the operating system of the system. The contents of the file can be displayed using the cat command.

However, this method only works for versions of Ubuntu 16.04 and later.

cat /etc/os-release

Output:

NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
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"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

It shows the version of the installed Ubuntu is 18.04.4.

Check Ubuntu Version Using the hostnamectl Command

hostnamectl is the command-line utility to set the hostname of a system. It can also check the version of Ubuntu installed in our system.

It is only available for Ubuntu 16.04 or later versions.

hostnamectl

Output:

  Static hostname: zeppy-G7-7588
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: dc64e42ca570453db4294738fe976109
           Boot ID: 8f4e5173ef214acba4dbe3cb65d2363b
  Operating System: Ubuntu 18.04.4 LTS
            Kernel: Linux 5.4.0-42-generic
      Architecture: x86-64

It shows the version of Ubuntu in our system is 18.04.4 LTS.

Check Ubuntu Version Using the Gnome

Gnome is the default desktop environment of Ubuntu 18.04. Earlier versions of Ubuntu used Unity as a default desktop environment.

To check the Ubuntu version using Gnome, we perform the following steps:

  • Click on the Settings icon to open the settings window.
  • Click on the Details tab on the settings window.
Author: Suraj Joshi
Suraj Joshi avatar Suraj Joshi avatar

Suraj Joshi is a backend software engineer at Matrice.ai.

LinkedIn