How To Check Linux Version.
This article shows how to check what Linux distribution and version is installed on your system using the command line.
Some of the most popular Linux distributions are Debian, Red Hat, Ubuntu, Arch Linux, Fedora, CentOS, Kali Linux, OpenSUSE, Linux Mint, etc.
A Linux distribution is an operating system made from a Linux kernel, GNU tools and libraries, and software collections. Usually, Linux distributions include desktop environments, package management system, and a set of preinstalled applications.
The lsb_release utility displays LSB (Linux Standard Base) information about the Linux distribution. This command should work on all Linux distributions that have the lsb-release package installed:
The Linux distribution and version are shown in the Description line. As you can see from the output above, I have Debian GNU/Linux 9.5 (stretch) installed on my system.
Instead of printing all of the above information, you can display the description line, which shows your Debian version passing the -d switch.
The output should look similar to below:
If you get “command not found: lsb_release” you can try to identify the Linux version using some of the other methods below.
The /etc/os-release file contains operating system identification data, including information about the distribution. This file is part of the systemd package and should be present on all system running systemd.
To view the contents of the os-release file, use either cat or less :
The output should look something like below:
The /etc/issue file contains a system identification text that is printed before the login prompt. Usually, this file includes information about the Linux version:
The output will look something like this:
hostnamectl utility is part of systemd and is used to query and change the system hostname. This command also displays the Linux distribution and kernel version .
If none of the commands above work for you, then most likely, you are running a very old and outdated Linux distribution. In this case, you can use one of the following commands, which should print the content of the distribution release or version file:
You can find more information about the release/version files at this link .
The uname command displays several system information, including the Linux kernel architecture, name, version, and release.
To find out what version of the Linux kernel is running on your system, type the following command:
The output above tells us that the Linux kernel is 64-bit, and its version is “4.9.0-8-amd64”.
There are several different commands that can help you find out the Linux distribution and version is running on the system.
Comments are closed.