SOLVED: Check Ubuntu Version the RIGHT WAY


Ubuntu

If you are an Ubuntu user, there is a high probability you have come across an error, and you went online to find a solution from the various tech forums. Unfortunately, some solutions won't work since you use a different version/ release of Ubuntu from the one mentioned in the solution. There are also situations where you want to install an application, but you get an error like, "Repository does not have a release file." Therefore, knowing the Ubuntu release running on your Computer is quite essential.

To better understand these differences in Ubuntu versions, we need to discuss the Ubuntu release cycle before you can check Ubuntu version.

 

Ubuntu Release Cycle

Ubuntu is made available to users through the Long Term Support release (LTS) and Interim releases. As the name suggests, Long Term Releases or commonly referred to by the abbreviation LTS is the Ubuntu version supported for the longest time. That is always up to five years for standard support and ten years for Enterprise-grade support. LTS releases are published after every two years in April. As of writing this post, the most popular Ubuntu LTS releases are Ubuntu 180.4 and Ubuntu 20.04.

On the other hand, Interim releases are published every six months LTS releases and are only supported for nine months. As of writing this post, the latest interim release is Ubuntu 21.10 that uses the code name Impish Indri.

This post will give you a detailed guide on checking the Ubuntu version running on your system. There are two ways which we can use to achieve this:

  • The Command-line method (Terminal)
  • The Graphical User interface (GUI)

 

If you are a command-line person, then you have more than enough methods which you can use to check the version of Ubuntu running on your system. All you need is to run a simple command, and you are good to go.

 

Method-1: Use the lsb_release -a Command

The lsb_release command which is present in all Linux systems shows the Linux Standard Base (LSB) information about the current Linux distribution running on your system. That includes the codename and version number. Follow the steps below.

Launch the Terminal from the applications menu or use the keyboard shortcut (Ctrl + Alt + T)

Type the command "lsb_release -a" into the command line and press enter.
SOLVED: Check Ubuntu Version the RIGHT WAY

From the image above, you will get information like Distributor ID, Description, Release version, and the release code name.

 

Method-2: Read the Contents of /etc/lsb-release File

This method is not very different from the lsb_release -a command. Instead of using the -a parameter, we will just read the contents inside the lsb_release file present in the /etc directory using the cat command. Follow the steps below.

Launch the terminal from the applications menu or use the keyboard shortcut [Ctrl] + [Alt] + [T].

Type the command cat /etc/lsb-release into the command line and press Enter.
SOLVED: Check Ubuntu Version the RIGHT WAY

From the image above, you can see the terminal displays the Ubuntu version you're running under DISTRIB_RELEASE and DISTRIB_DESCRIPTION parameters.

 

Method-3: Read the Contents of the /etc/os-release File

Before we dive in on how to use this method, let's discuss the files lsb_release and os_release in detail since they are somewhat similar.

The /etc/lsb-release file is found in most (but not all) Linux distributions intended for use by older programs. The LSB which stands for Linux Base Standards is a project that defines rules and standards Linux distros should follow. However, not all Linux systems include these file.

On the other hand, the /etc/os-release file is that standard set and you will find it in almost all Linux distributions. Additionally, any Systemd-based distribution like Ubuntu, RHEL, CentOS, Gentoo, etc is required to have it by default. Therefore, if the lsb-release command above didn't work for you, you should try using the os-release. Follow the steps below.

Launch the Terminal

Display the contents of the /etc/os-release file using the cat command as shown below.

cat /etc/os-release

SOLVED: Check Ubuntu Version the RIGHT WAY

From the image above, you can view the version of Ubuntu running on your system next to the VERSION_ID parameter.

 

Method-4: Read the Contents of the /etc/issue File

The /etc/issue file is a standard file across all distributions which contains a message to be displayed before the logging prompt.

Open the terminal using “Show Applications” or with the keyboard shortcut [Ctrl] + [Alt] + [T].

Type the command "cat /etc/issue" into the command line and press enter.

SOLVED: Check Ubuntu Version the RIGHT WAY

 

Method-5: Check Ubuntu Version with hostnamectl Command

Another command that also gives you information about the Ubuntu version is the hostnamectl command. Run the command as shown below.

SOLVED: Check Ubuntu Version the RIGHT WAY

 

Method-6: View the Ubuntu version via GUI

In the case you don't like to use the command line, there's always a way to view the Ubuntu version via GUI. This will be different depending on the desktop environment you're using. In the GNOME desktop environment on Ubuntu, the available information is found in the Settings > About section.

SOLVED: Check Ubuntu Version the RIGHT WAY

 

Conclusion

Ubuntu offers many ways for us to check the version of the operating system. Knowing which version of Ubuntu you're on, and what type of release it is – either long term support or interim – will help you determine several things like when to update, which software to install, and much more. We recommend keeping your Ubuntu system up-to-date, especially with the latest LTS releases. However, if you love living on the bleeding edge, you can also check out the interim releases which come with the latest features.

 

Deepak Prasad

Deepak Prasad

He is the founder of GoLinuxCloud and brings over a decade of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive experience, he excels in various domains, from development to DevOps, Networking, and Security, ensuring robust and efficient solutions for diverse projects. You can connect with him on his LinkedIn profile.

Can't find what you're searching for? Let us assist you.

Enter your query below, and we'll provide instant results tailored to your needs.

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can send mail to admin@golinuxcloud.com

Thank You for your support!!

Leave a Comment