Ubuntu is one of the most popular Linux distributions installed and used around the world by millions of users. Ubuntu can be found on servers, old computers, and high-tech computers and is even used by many organizations.
Knowing your Ubuntu version is important to keep the system up-to-date with the latest system updates and security updates. In this post, we’ll go through a few alternative methods for determining the Ubuntu version.
1. lsb_release Command
The lsb_release is a command line utility to display information related to your Linux system, which displays information such as Distribution ID, Description, Release, etc.
First, fire up a new terminal session with
“CTRL + ALT + T” or search for “terminal” in the applications drawer.
$ lsb_release -a
This will display all LSB (Linux Standard Base) information. The
“-a” flag instructs the lsb_release command to display all the LSB information available.
To only get the Ubuntu version run:
$ lsb_release -d
2. /etc/os-release File
The /etc/os-release is a standard file in Linux systems that contains information about the operating system distribution, which is located in the /etc directory and can be viewed using the cat command in the terminal.
$ cat /etc/os-release
The information is in the form of key-value pair. Users can use this information for many things like updating to the latest version or switching to an LTS version. The file holds more information about your operating system compared to the “lsb_release” command.
3. /etc/lsb-release File
The /etc/lsb-release file contains information about the distribution’s ID, release version, codename, and a human-readable description of the distribution.
$ cat /etc/lsb-release
4. /etc/issue File
If you quickly want to look only for the version of your Ubuntu system and not any other information you can do it with.
$ cat /etc/issue
This file usually has the content stored related to the pre-login message like a login prompt or a login message. Initially, it also contains system information like the Ubuntu version.
5. hostnamectl Command
The hostnamectl command is used to manage the hostname on your Linux system. With hostnamectl, we can view and change the hostname of the Ubuntu system. A hostname is nothing but a unique name assigned to your system on a network.
For eg: When you launch a terminal session in Ubuntu you will see a line like the one below by default –
where “chinmay29hub” is the username and “UbuntuMint” is the hostname.
Although, we can use hostnamectl for our benefit today. By simply running hostnamectl without any additional parameters it displays system information like hostname, chassis, kernel, OS, etc.
Compared to other commands it also displays some information about the system hardware which can be beneficial in some scenarios.
6. Ubuntu System Settings
Open “settings” in the applications drawer and head to the “About” section. Here you will find all the system information like Ubuntu version, hardware, memory, etc.
By following this article you can now quickly know about your Ubuntu version. It is recommended to update your system with the latest packages. Knowing the Ubuntu version running on your system is important for various reasons, including software compatibility, troubleshooting, and security.