Summary
In this article we will learn about 5 different methods to find the Ubuntu version of your system. Knowing the Ubuntu version of your Operating System is also important. It is always a recommendation to use Long Term System(LTS) and latest version should be used. In case you want to upgrade your Operating System also, you need to find Ubuntu version of your system.
4 Terminal Commands to find the Ubuntu version
Here in this section, we are mentioning the 4 terminal commands through which you can find the Ubuntu version.
lsb_release command
Open the terminal and run the given below command. In this command, you will also find the Codename of the Ubuntu Operating System.
sudo lsb_release -a
hostnamectl command
Use this command where you will also find also very useful information. But in the output, you will easily find the Ubuntu version.
hostnamectl
Read lsb-release File
Similar to lsb_release command, the name of file is lsb-release. It also has Ubuntu version related information.
cat /etc/lsb-release
Read issue file
In this file, you will get information of Ubuntu version.
cat /etc/issue
GUI Method
You can also find the Ubuntu version in Graphical mode.
In Graphical User Interface(GUI), Go to Dash Home > System > About.
Frequently Asked Questions (F.A.Q)
Any scenario where we can use these command in bash scripting or any automation tool?
Yes, in bash scripting or any scripting we also first check what is the Operating System version, type and other details. When condition matches then the further action will be taken from the script. For example, if we want to install a specific Nginx version only in Ubuntu 24.04 LTS then we can use these terminal commands to find out what is the Ubuntu version is. This kind of scenario is also used with other Automation tools and utility like Ansible, Chef, Puppet, Salt etc.
Is it interview question?
Yes, this is also important question. Because it is very basic and expected from the Engineer that they should be aware of the method to find Operating System version.