Checking the version of Ubuntu typically refers to determining the specific release version or codename of the Ubuntu operating system installed on a system. To check the version of Ubuntu you’re running, you can use the following command:
lsb_release -a
Apart from this, there are several ways to check the Ubuntu version. They are listed below:
1. Check Ubuntu Version Using “lsb_release” Command
The lsb_release is a command used to display Linux Standard Base (LSB) and distribution-specific information about the Linux distribution you are using. You can check the Bash version using the lsb_release command along with the release option and -a
argument:
lsb_release -a
In the image above, running the command gives you the Ubuntu version.
2. Check Ubuntu Version Using “hostnamectl” Command
The hostnamectl command is a utility in Linux used for querying and changing the system hostname and related settings. It also allows users to view and modify the hostname as well as related settings and Ubuntu versions.
hostnamectl
After running the command, you can see the Ubuntu version on your computer screen.
3. Check Ubuntu Version Using “neofetch” Command
The neofetch command is a simple, yet popular, command-line utility used to display system information and details about the operating system in a visually appealing way. You can use it to obtain system information including the version of your Ubuntu:
neofetch
In this picture, you can see the system information including the Ubuntu version is shown in a formatted, colored way.
4. Check Ubuntu Version from the Issue File
In Linux, the issue file contains information about the operating system release and version. It is typically located in the /etc/ directory. You can write a Bash script that will open this file and show you the version of Ubuntu.
cat /etc/issue
As you can see in this image, after running the script, I got the Ubuntu version printed on my screen.
5. Check Ubuntu Version from the Os-release File
The /etc/os-release file in Ubuntu is a vital source of information about the operating system. It provides a variety of information about the Ubuntu distribution, such as the version, codename, and other crucial characteristics.
cat /etc/os-release
Here you can see that running the Bash script printed information of the os-release file, including the Ubuntu version.
Conclusion
Knowing the Ubuntu version is an easy task, no matter what process you follow. But checking the version using Bash scripting is easier because, even if the version updates, you just have to run a script to check the most recent version. You can do it with just one command in seconds using a bash script. Feel free to let me know if you have further queries on this topic.
People Also Ask
How do I check the Ubuntu version in a shell?
To check the Ubuntu version in the shell you can use the command line interface, and type any of these commands lsb_release -a
, cat etc/os-release
, or cat /etc/issue
.
How do I check the Linux kernel version?
You can use the command uname -r
to check the Linux Kernel version that you are using. It will show users the version of Linux kernel as well as some additional information.
How do I check the node version in Ubuntu?
If you want to know the node version in Ubuntu, you must have installed the node js in your system. To install it, run the command sudo apt install nodejs
, and then run the command node -v
.
How do I check the WSL version on Ubuntu?
To check the WSL version, open the PowerShell or Windows Command Prompt. Then enter the command wsl -l -v
and this will display the WSL version in Ubuntu.
Related Articles
- How to Get Date in Bash [2 Methods with Examples]
- How to Print Time in Bash [2 Quick Methods]
- How to List Users in Bash [2 Easy Ways]
- How to Get Current Time in Bash [4 Practical Cases]
- How to Use Date Format in Bash [5 Examples]
- How to Get Timestamp in Bash [2 Practical Cases]
- How to Copy and Paste in Bash [2 Methods & Cases]
- How to Read Password in Bash [3 Practical Cases]
- How to Send Email in Bash [2 Easy Methods]
- Bash Script to Send Email with Attachment [Step-by-Step Guide]
- How to Get IP Address in Bash [3 Methods]
- How to Find and Replace String in Bash [5 Methods]
- How to Get Script Name Using Bash Script? [3 Easy Ways]
- How to Call Another Script in Bash [2 Methods]
- How to Generate UUID in Bash [3 Simple Methods]
- 3 Easy Ways to Write to a File in Bash Script
- How to Write the Output to a File in Bash Script [5 Practical Cases]
- How to Create a List in Bash Scripts? [2 Easy Methods]
- How to Clear History in Bash [2 Practical Cases]
- How to Clear Screen Using Bash Script? [2 Effective Methods]
<< Go Back to Bash Script Examples | Bash Scripting Basics | Bash Scripting Tutorial
FUNDAMENTALS A Complete Guide for Beginners