How to Check Ubuntu Version

August 15, 2024

Introduction

Ubuntu is a free, open-source Linux-based operating system (OS) with many release versions. Knowing which Ubuntu version is running on your system is important when troubleshooting or searching for installation guides.

In this tutorial, learn how to check the Ubuntu version running on your machine.

How To Check Ubuntu Version

Prerequisites

Check Ubuntu Version via Command Line

There are several ways to check the Ubuntu version using the terminal. The following text covers these methods.

Check Ubuntu Version with lsb_release Command

The lsb_release command provides information about your Linux distribution. It displays details about the distribution name, release number, codename, and description.

To verify the Ubuntu version via the lsb_release command, run:

lsb_release -a
terminal output for lsb_release -a

The output displays the current version of Ubuntu. In the example above, it is Ubuntu 22.04 (codenamed Jammy Jellyfish).

To display only the description line, use the -d tag:

lsb_release -d
lsb_release -d terminal output

Show only the description information by adding the -s tag to shorten the output:

lsb_release -ds
lsb_release -ds terminal output

Add the -c tag to display the codename line as well:

lsb_release -dc
lsb_release -dc terminal output

Show only the release number by combining the -r and -s tags:

lsb_release -rs
lsb_release -rs terminal output

Check Ubuntu Version with cat /etc/lsb-release Command

Another way is to use cat command to display the contents of the /etc/lsb-release file. This file contains information about the Linux distribution, such as the distribution name, release version, and codename.

Run the following:

cat /etc/lsb-release
cat /etc/lsb-release terminal output

Check Ubuntu Version with cat /etc/*release Command

To get more in-depth information about the Ubuntu release, use the command cat /etc/*release. The command prints the contents of the files in the /etc/ directory that match the release wildcard.

Run the following:

cat /etc/*release
cat /etc/*release terminal output

Check Ubuntu Version with hostnamectl Command

Another command that also gives you information about the Ubuntu version is the hostnamectl command:

hostnamectl
hostnamectl terminal output

The command displays the system's hostname and key system information, such as the OS version, kernel version, machine ID, virtualization type, and architecture.

Check Ubuntu Version with cat /etc/issue Command

The /etc/issue file contains a message displayed before the login prompt on a terminal. The message includes the operating system's name and version.

Use the cat command to fetch the file contents:

cat /etc/issue
cat /etc/issue terminal output

The /etc/issue.net file contains a simpler version of the login message. Therefore, for a cleaner output, use:

cat /etc/issue.net
cat /etc/issue.net terminal output

Check Ubuntu Version Using screenfetch

The screenfetch is a Linux utility that generates useful and visually pleasing OS information. It contains an ASCII art logo of your Linux distribution.

To install screenfetch, run:

sudo apt install screenfetch
sudo apt install screenfetch terminal output

Execute the command with:

screenfetch
check Ubuntu version via screenfetch

The output displays system information, including the Ubuntu version.

Check Ubuntu Version Using neofetch

The neofetch utility is a Bash script and a more modern version of screenfetch. To install neofetch, run the following:

sudo apt install neofetch
sudo apt install neofetch terminal output

Run the command:

neofetch
check Ubuntu version via neofetch

The OS section displays the Ubuntu version.

Check Ubuntu Version via the Graphical Interface

Another way to check the Ubuntu version running on your system is through the Graphical User Interface (GUI). Follow these steps:

1. Click the Show Applications button.

Show Applications button

2. In the search bar, enter settings.

typing settings in the search bar

3. Click the Settings icon once it appears in the results.

4. Click the About tab.

check Ubuntu version via GUI, About section in settings

The About section displays the Ubuntu version number and other information about your operating system.

Ubuntu version in the About section

Why Should You Check the Ubuntu Version?

Checking your Ubuntu version is crucial for several reasons:

  • Ensuring software compatibility. Software packages often require specific Ubuntu versions. Knowing your version allows you to confirm compatibility before installing new software.
  • Staying updated with security patches. Older Ubuntu versions might no longer receive security patches, which leaves your system exposed to vulnerabilities. Checking the version helps you keep the system secure by ensuring it receives the latest updates.
  • Managing the system. For system administrators, knowing the exact Ubuntu version is crucial for applying the correct updates, configurations, and security patches.
  • Optimizing performance. Some Ubuntu versions are more optimized for particular hardware, leading to better performance. By checking the version, you can determine if an upgrade or a fresh installation improves the system's efficiency.
  • Accessing new features. Newer Ubuntu releases often introduce new features and improvements. Knowing your current version allows you to assess whether upgrading to a newer version will give access to these enhancements.
  • Troubleshooting. Knowing the Ubuntu version is essential for diagnosing and resolving system problems, as many solutions and commands are version-specific.

Conclusion

This article explained how to check the Ubuntu version using the command line or GUI. It also elaborated on the importance of knowing which Ubuntu version you are running.

Next, learn how to install Ubuntu 24.04 on your system.

Was this article helpful?
YesNo
Sara Zivanov
Sara Zivanov is a technical writer at phoenixNAP who is passionate about making high-tech concepts accessible to everyone. Her experience as a content writer and her background in Engineering and Project Management allows her to streamline complex processes and make them user-friendly through her content.
Next you should read
How to Check Kernel Version in Linux in Command Line
April 18, 2024

The Linux kernel is much like the central brain of the operating system. Although it is the open-source meaning ...
Read more
How to List Installed Packages on Ubuntu
March 9, 2022

Having a precise list of installed packages helps system admins maintain, replicate, and reinstall systems.
Read more
How to Check CentOS Version?
April 8, 2019

There are many reasons why you should know the CentOS version you are running. For example, if you are ...
Read more
How to Check Linux Red Hat (RHEL) Version Installed On Your System
September 5, 2024

Red Hat is a popular and influential fork of the Linux operating system. Many Linux operating systems based ...
Read more