7 Ways to Check Ubuntu Version on Your Server

7 Ways to Check Ubuntu Version on Your Server

This article continues the essential Linux topic and provides 7 ways to check the Ubuntu version on your server. We will cover motd/etc/lsb-release, and /etc/os-release files, lsb_releasehostnamectl, and neofetch utilities. Choose your personal most suitable way to check the Ubuntu version on your server in 2 minutes!

The Ubuntu server (Ubuntu Linux) is a free and open-source operating system. Ubuntu is the most popular and widely used Linux distribution nowadays used as a desktop and a server operating system.

One of the most common questions arises when you administer many Ubuntu servers is which OS version does the server has.

This article will cover the most common ways to figure out the answer to the question above.

lsb_release

LSB stands for Linux Standard Base. LSB gives you specific information, including the release codename, version number, and distribution ID of your Linux Distribution.

You may install this utility using the following command:

$ apt-get update

$ apt-get install -y lsb-release

Now, use the following command to get the OS version:

$ lsb_release -a

Here’s an expected output:

Check Ubuntu version - lsb_release command

/etc/lsb-release

/etc/lsb-release is another source of your Ubuntu server OS version. Execute the following command to get an Ubuntu version:

$ cat /etc/lsb-release

The output:

Check Ubuntu version - lsb_release file

/etc/issue

Like from /etc/lsb-release, you can get your Ubuntu version from /etc/issue file:

$ cat /etc/issue

Here’s an expected output:

Check Ubuntu version - issue file

/etc/os-release

Another file you may get Ubuntu OS version from is /etc/os-release:

$ cat /etc/os-release

This file contains more detailed information about your Ubuntu system.

Check Ubuntu version - os-release file

motd

motd is an abbreviation of Message OThe Day. The purpose of this tool is to provide you information about the system when you’re logging into the server using SSH, for example.

Check Ubuntu version - modt

hostnemctl

This command sets up the hostname in Ubuntu, but it is also another easy way to view the Ubuntu version. Type the following command in your terminal:

$ hostnamectl

The output of this command will contain the Ubuntu OS version.

Check Ubuntu version - hostnamectl command

neofetch

Neofetch yet another Ubuntu app, which provides a beautiful system info output to the users. You can use this tool to get the version and other details of your Ubuntu server.

To install neofetch, use the following commands:

$ apt-get update

$ apt-get -y install neofetch

Next, you can call it directly in your terminal:

$ neofetch

The output will provide you with the Ubuntu release number, the Linux kernel version, and other essential details of your server.

Check Ubuntu version - neofetch command

Summary

Anyone can follow our guidance and get the Ubuntu OS version on the server quickly and easily. We hope you find this article useful. If so, please, help us to spread it to the world!

If you still have any questions, comment, or you can share another useful method of getting the Ubuntu version using CLI, please, feel free to share your thought in the comments section below.