How to Check your Ubuntu Version

Updated on

3 min read

Check Ubuntu Version

When you log in to an Ubuntu system for the first time, before doing any work, it is always a good idea to check what version of Ubuntu is running on the machine.

New Ubuntu releases come out every six months, while LTS (Long Term Support) releases occur every two years. LTS versions are supported for five years on both desktop and server. Other standard releases are supported for nine months.

This article will show you how to find your Ubuntu version using the command line or from within the graphical interface.

How to Check Ubuntu Version from the Command Line

There are several commands that you can use to find out what version of Ubuntu you are running.

The lsb_release utility displays LSB (Linux Standard Base) information about the Linux distribution.

The preferred method to check your Ubuntu version is to use the lsb_release utility, which displays LSB (Linux Standard Base) information about the Linux distribution. This method will work no matter which desktop environment or Ubuntu version you are running.

Follow the steps below to check the Ubuntu version from the command line:

  1. Open your terminal either by using the Ctrl+Alt+T keyboard shortcut or by clicking on the terminal icon.

  2. Use the lsb_release -a command to display the Ubuntu version.

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

    Your Ubuntu version will be shown in the Description line. As you can see from the output above, I am using Ubuntu 18.04 LTS.

    Instead of printing all of the above information, you can display the description line, which shows your Ubuntu version passing the -d switch.

    lsb_release -d

    The output should look similar to below:

    Description:    Ubuntu 18.04 LTS

Alternatively, you can also use the following commands to check your Ubuntu version.

Check Ubuntu version using the /etc/issue file

The /etc/issue file contains a system identification text. Use the cat command to display the contents of the file:

cat /etc/issue

The output will look something like the below:

Ubuntu 18.04 LTS \n \l

Check Ubuntu version using the /etc/os-release file

/etc/os-release is a file that contains operating system identification data. This file can be found only on the newer Ubuntu versions running systemd.

This method will work only if you have Ubuntu 16.04 or newer:

cat /etc/os-release

The output will look something like below:

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

Check Ubuntu version using the hostnamectl command

hostnamectl is a command that allows you to set the system hostname, but you can also use it to check your Ubuntu version.

This command will work only on Ubuntu 16.04 or newer versions:

hostnamectl
   Static hostname: linuxize
         Icon name: computer-vm
           Chassis: vm
        Machine ID: f1ce51f447c84509a86afc3ccf17fa24
           Boot ID: 2b3cd5003e064382a754b1680991040d
    Virtualization: kvm
  Operating System: Ubuntu 18.04 LTS
            Kernel: Linux 4.15.0-22-generic
      Architecture: x86-64

Check Ubuntu Version in the Gnome Desktop

Gnome is the default desktop environment in Ubuntu 18.04 (Bionic Beaver). Previous versions of Ubuntu used Unity as the default desktop environment.

Follow the steps below to check your Ubuntu version if you are using Gnome:

  1. Open the system settings window by clicking on the Settings icon, as shown in the image below:

    Ubuntu System Settings
  2. In the system settings window, click on the Details tab:

    Check Ubuntu Version

    Your Ubuntu version will be shown under the orange Ubuntu logo.

Conclusion

We have shown you how to find the version of Ubuntu installed on your system. For more information on Ubuntu releases visit the Ubuntu Releases page.

Feel free to leave a comment if you have any questions.