×
check ubuntu version – 5 different commands and syntax

Sometimes you will need to find out the version of Ubuntu is running on the machine. This will help you to apply security patches and software updates. You can find the Ubuntu version using in the command line or via the graphical interface.

In this tutorial, we will show you several ways to check the Ubuntu version.

Requirements

  • Ubuntu 18.04 desktop installed on your system.

Check the Ubuntu version from CLI

The simple and easiest way to find the Ubuntu version is to use lsb_release utility. Open your terminal and run the following command:

lsb_release -a

You should see your Ubuntu version in the following output:


Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

You can also see the sample output in the following screen:

You can also run the following command to display just your Ubuntu version instead of showing all of the above information:

lsb_release -d

You should get the following output:

Description: Ubuntu 18.04 LTS

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

You can also check the Ubuntu version with /etc/os-release file. This file contains all the information about your operating system.

cat /etc/os-release

You should get the following output:


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

You can also see the sample output in the following screen:

Check the Ubuntu version using the hostnamectl command

hostnamectl is a command-line utility that can be used to set the hostname of your system. It also allows you to check your Ubuntu version.

You can print your Ubuntu version information using the following command:

hostnamectl

You should get the following output:


Static hostname: ubuntu
Icon name: computer-vm
Chassis: vm
Machine ID: b32d49c8517d468e910e0ffa84de15e2
Boot ID: 1b6d58b9ed5141fc9b4e40c7ed400d59
Virtualization: oracle
Operating System: Ubuntu 18.04 LTS
Kernel: Linux 4.15.0-66-generic
Architecture: x86-64

You can also see the sample output in the following screen:

Check the Ubuntu version using the /etc/issue file

The /etc/issue file also contains the information of your running operating system.

You can display the content of /etc/issue file with the following command:

cat /etc/issue

You should get the following output:

Ubuntu 18.04 LTS \n \l

You can also see the sample output in the following screen:

Check the Ubuntu version from GUI

You can also check the Ubuntu version using the Unity desktop environment.

Follow the steps below to check the version of your operating system.

First, click on the system settings window in the top right bar of your desktop. You should see the following screen:

Now, click on the Details tab. You should see your Ubuntu version under the orange Ubuntu logo in the following screen:

Conclusion

In the above tutorial, we learned different method of how to find the Ubuntu version. Feel free to ask me if you have any questions.