How to Check Ubuntu Version Using Command Line

check ubuntu version

In this guide, we will show you how you can easily check which version of Ubuntu you have on your system. There are 2 main ways you can achieve this

  • Using the Terminal
  • Using the GUI

So let's dive in and see how you can use the above methods to check which version of Ubuntu resides on your system.

1) Using Terminal

This method works regardless of the Ubuntu release or desktop environment you are using.

To check the version, Open your terminal and run the following command

lsb_release -a

Output

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial

To be more specific you can also run

lsb_release -r

Output

Release:        16.04

Another way you can retrieve the version of your Ubuntu system is by running

cat /etc/lsb-release

Output

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.5 LTS"

To gather more detailed information run

cat /etc/*release

Output

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.5 LTS"
NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.5 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

In addition, this can also come in handy

# cat /etc/os-release

Output

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

To get information about the kernel and architecture run

uname -a

Output

Linux ubuntu-16-04-1 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Also, the hostnamectl command can help you get the version of Ubuntu you are running

hostnamectl

This will give more detailed information such as Operating System, kernel, Architecture and in case the system is virtualized, it will display virtualization type and chassis.

Output

 Static hostname: ubuntu-16-04-1
         Icon name: computer-vm
           Chassis: vm
        Machine ID: bc429e3618b24cebbb4ba8e951e20250
           Boot ID: 9b1912bef4064d1cb449a009c31fc1c6
    Virtualization: kvm
  Operating System: Ubuntu 16.04.5 LTS
            Kernel: Linux 4.4.0-57-generic
      Architecture: x86-64

Lastly, you can run this command on Terminal to give you the version of Ubuntu that you are running.

awk '/^Description: Ubuntu [0-9]/ {print "Ubuntu",$3; exit;}' /usr/share/python-apt/templates/Ubuntu.info

Output

Ubuntu 16.04

2) Using GUI - GNOME Desktop

If you are running Ubuntu from a Desktop environment, checking the version of Ubuntu is quite an easy and straight-forward thing to do.

If you are running Unity Desktop environment, Open 'System Settings' from the main menu as shown below

check which version of Ubuntu you have

Thereafter, click on the 'Details' icon as shown

check which version of Ubuntu you have

 

This is going to open a Window with a lot more information such as

  • CPU type
  • RAM capacity
  • Operating System
  • GPU

check which version of Ubuntu you have

If you are on GNOME display like in Ubuntu 18.04 and later, click on the drop-down arrow at the top left corner.

This will populate a pull-down menu. Select 'Settings' icon s shown

check which version of Ubuntu you have

In the next Window, scroll down and click on 'Details'

check which version of Ubuntu you have

This is going to display a ton of information including the OS type, CPU, RAM and system architecture

check which version of Ubuntu you have

And that's how you can check out your Ubuntu version and other System properties! Also, check out the neofetch tool you can easily use to populate system information. We hope this guide has been helpful. Drop your comments and feel free to share on your social platforms.

Read Also:

Jamie Arthur 6:40 am

About Jamie Arthur

James is a passionate Linux and Windows Systems Administrator with 4 years of experience in Linux, databases and Front-End development. He loves doing research on different Linux distributions and experimenting with installation and configuration of different services and features. His hobbies include swimming, reading novels and playing video games.

Author's All Posts
Like to become part of Linoxide Team and contribute tips? Contact us here.

Comments

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.