How to find OS version in Ubuntu Linux

last updated in Categories ,

I got a new Ubuntu server running on AWS. How do I check the version of Ubuntu I am running from the CLI?

Introduction: If you installed version of Ubuntu on Cloud based system, but if you do not know what version exactly it is. Here is how to find out your Ubuntu Linux version from the CLI. There are various ways to check which version of Ubuntu you are running. You can either check from within GUI, or put in a short command line in the bash shell Terminal.

How to find OS version in Ubuntu Linux

Command to find the version of Ubuntu that is installed on your server:

  1. Open the terminal application
  2. Another option is to log in to the remote Ubuntu server using the ssh command
  3. Type lsb_release -a to see OS version in Ubuntu Linux

Let see all commands in details.

How to check the version of Ubuntu Linux

The lsb_release command provides LSB (Linux Standard Base) and distribution-specific information on the CLI. The syntax is:
$ lsb_release -a
Sample outputs:

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

So I am using Ubuntu Linux version 18.04.1 LTS codenamed “bionic”.

Use hostnamectl command to find Ubuntu OS version

Another option is to run the following hostnamectl command that cControl the system hostname. It also displays operating system info. Just run the following command:
$ hostnamectl
Outputs:

   Static hostname: nixcraft-asus.nixcraft.com
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: 5676e0534ca04d58a94e207dd7617dc3
           Boot ID: 4b33025d11fa4b2fa932d735961412fd
  Operating System: Ubuntu 18.04.1 LTS
            Kernel: Linux 4.19.2
      Architecture: x86-64

Checking your Ubuntu Version using GUI

Open System Settings by pressing the Super key on your keyboard and type “settings”. Click on Details. You will see version below Ubuntu Logo:
Find OS version in Ubuntu Linux using GUI

How to check Ubuntu version in the Terminal

The following method will work no matter which version of Ubuntu or desktop environment or cloud sever you are using. Open the Terminal (type keyboard shortcut: Ctrl+Alt+T). Type any one of the following commands:
$ lsb_release -a
$ hostnamectl
$ cat /etc/*release

Checking your Ubuntu Version using the terminal bash shell
The last one use the cat command to display /etc/lsb-release and /etc/os-release files on screen.

Conclusion

You learned how to check OS version in Ubuntu Linux using both GUI and CLI (command line interface) methods.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at www.nixcraft.com

Historical Comment Archive

3 comment

  1. I google “How do I check the version of Ubuntu I am running?” and I found this page. Was very useful to me. Thanks you dear. God bless you.

    1. To find the version of Ubuntu that is installed on server, I always used
      cat /etc/issue
      cat /proc/version
      uname -a

  2. Ubuntu show version number command I like on my companies Linode server:

    lsb_release -a

    I work as a web dev. By knowing version I know what version of PHP it runs.

    Have a question? Post it on our forum!