BLOG POSTS
How to Check Ubuntu Version

How to Check Ubuntu Version

Knowing the version of Ubuntu running on your system can be helpful for various reasons, such as troubleshooting, compatibility checks, or simply keeping track of updates. In this guide, we will explore different methods to check your Ubuntu version.

Method 1: Using the lsb_release Command

The lsb_release command provides information about the Linux Standard Base (LSB) and the distribution-specific information, including the Ubuntu version.

To check the Ubuntu version using the lsb_release command, open a terminal and type:

lsb_release -a

This command will display detailed information about your Ubuntu version, including the release number, codename, and more.

Method 2: Checking the /etc/os-release File

Another way to check your Ubuntu version is by examining the /etc/os-release file. This file contains information about the operating system, including the version and codename.

To view the contents of the /etc/os-release file, open a terminal and type:

cat /etc/os-release

This command will display the contents of the file, including the VERSION_ID field, which indicates your Ubuntu version.

Method 3: Using the uname Command

The uname command provides information about the Linux kernel and can also be used to check the Ubuntu version.

To check the Ubuntu version using the uname command, open a terminal and type:

uname -r

This command will display the kernel release version, which typically includes the Ubuntu version number.

Similar Commands

There are a few other commands that can be used to check the Ubuntu version:

  • cat /etc/lsb-release: This command displays the contents of the /etc/lsb-release file, which contains information about the Ubuntu version.
  • lsb_release -d: This command provides a brief description of the Ubuntu version.
  • lsb_release -r: This command displays only the release number of the Ubuntu version.

Script to Check Ubuntu Version

If you need to check the Ubuntu version frequently or automate the process, you can create a simple bash script.

Here is an example of a bash script that checks the Ubuntu version:


#!/bin/bash

version=$(lsb_release -rs)
echo “Ubuntu version: $version”

Save the script in a file, such as check_ubuntu_version.sh, and make it executable using the following command:

chmod +x check_ubuntu_version.sh

To run the script, simply execute the following command:

./check_ubuntu_version.sh

The script will display the Ubuntu version on the terminal.

Useful Data

Here is a table summarizing the Ubuntu version numbers and their corresponding codenames:

Version Number Codename
20.04 Focal Fossa
18.04 Bionic Beaver
16.04 Xenial Xerus
14.04 Trusty Tahr

Now that you know different methods to check your Ubuntu version, you can easily find the information you need. Whether you are a beginner or an experienced user, having this knowledge can be valuable for managing your Ubuntu system effectively.



This article incorporates information and material from various online sources. We acknowledge and appreciate the work of all original authors, publishers, and websites. While every effort has been made to appropriately credit the source material, any unintentional oversight or omission does not constitute a copyright infringement. All trademarks, logos, and images mentioned are the property of their respective owners. If you believe that any content used in this article infringes upon your copyright, please contact us immediately for review and prompt action.

This article is intended for informational and educational purposes only and does not infringe on the rights of the copyright owners. If any copyrighted material has been used without proper credit or in violation of copyright laws, it is unintentional and we will rectify it promptly upon notification. Please note that the republishing, redistribution, or reproduction of part or all of the contents in any form is prohibited without express written permission from the author and website owner. For permissions or further inquiries, please contact us.

Leave a reply

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