How to Check Your Ubuntu Version: 4 Simple and Reliable Methods

Introduction

Ubuntu is one of the most popular Linux distributions used worldwide. However, when troubleshooting system issues or performing software updates, you may need to check which version of Ubuntu you’re running. This is especially important because certain commands or configurations can vary between versions. In this article, we’ll explain four simple ways to check your Ubuntu version — even if you’re a beginner. Each method has its own advantages, allowing you to choose the best one depending on your situation.

Method 1: Using the lsb_release -a Command

The lsb_release -a command is the most recommended method for checking your Ubuntu version. It provides detailed information about the distribution, including the version number and code name, all in one output — making it useful for both system administrators and regular users.

Steps:

  1. Open the terminal.
  2. Enter the following command:
    bash lsb_release -a
  3. The output will look like this:
    Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal

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

The /etc/os-release file contains detailed system information, including the Ubuntu version and distribution name. This method uses the cat command to display the file’s content, allowing you to easily confirm your OS version.

Steps:

  1. Open the terminal.
  2. Enter the following command:
    bash cat /etc/os-release
  3. The output will appear as follows:
    NAME="Ubuntu" VERSION="20.04.3 LTS (Focal Fossa)" ID=ubuntu PRETTY_NAME="Ubuntu 20.04.3 LTS"

Method 3: Checking the /etc/issue File

The /etc/issue file contains the message displayed before the login prompt, and it includes your Ubuntu version. This method is simple and ideal when you just need a quick version check.

Steps:

  1. Open the terminal.
  2. Enter the following command:
    bash cat /etc/issue
  3. The result will look like this:
    Ubuntu 20.04.3 LTS \n \l

Method 4: Using the hostnamectl Command

The hostnamectl command is mainly used to view or change the system’s hostname, but it can also display Ubuntu version details. It’s particularly useful for system administrators who want to see both the hostname and OS version in one command.

Steps:

  1. Open the terminal.
  2. Enter the following command:
    bash hostnamectl
  3. The output will look like this:
    Operating System: Ubuntu 20.04.1 LTS

Comparison Table

MethodAdvantagesBest Use Case
lsb_release -aDisplays all key information at onceGeneral Ubuntu version check
/etc/os-releaseShows detailed version and support informationWhen you need in-depth OS release details
/etc/issueSimple and quick checkWhen confirming version during login
hostnamectlDisplays hostname and version togetherUseful for system or server management

Conclusion

Checking your Ubuntu version is an important step in system administration. Each method has unique advantages, and using the right one helps you manage your system more efficiently. For beginners, the lsb_release -a command is the easiest and most straightforward option. However, knowing other methods allows you to access detailed system information when needed. Make it a habit to check your version regularly to ensure smooth updates and proper support.