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.
Prerequisites
- A system running Ubuntu.
- Access to a user account with sudo or root privileges.
- Access to the terminal.
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
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
Show only the description information by adding the -s
tag to shorten the output:
lsb_release -ds
Add the -c
tag to display the codename line as well:
lsb_release -dc
Show only the release number by combining the -r
and -s
tags:
lsb_release -rs
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
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
Check Ubuntu Version with hostnamectl Command
Another command that also gives you information about the Ubuntu version is the hostnamectl
command:
hostnamectl
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
The /etc/issue.net file contains a simpler version of the login message. Therefore, for a cleaner output, use:
cat /etc/issue.net
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
Execute the command with:
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
Run the command:
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.
2. In the search bar, enter settings.
3. Click the Settings icon once it appears in the results.
4. Click the About tab.
The About section displays the Ubuntu version number and other information about your operating system.
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.