Banner of how to check linux version

How to Check Your Linux Distribution and Version


Category: Linux

Date: February 2023
Views: 533


If you're a Linux user, it's important to know which distribution and version of Linux you're running. This information can be useful when troubleshooting issues or installing software that requires a specific version of Linux.

When people refer to Linux, they are usually referring to a Linux distribution. Strictly speaking, Linux is a kernel, the core component of the operating system that, simply put, acts just like a bridge between the software applications and the hardware. 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.

Some of the most popular Linux distributions are:

  • Debian
  • Red Hat
  • Ubuntu
  • Arch Linux
  • Fedora
  • CentOS
  • Kali Linux
  • OpenSUSE
  • Linux Mint

When you log in to a Linux system for the first time, before doing any work, it is always a good idea to check what version of Linux is running on the machine. For example, determining the Linux distribution can help you figure out what package manager you should use to install new packages.

Here are a few ways to check which distribution and version of Linux you're running:

1. Use the lsb_release Command

The lsb_release command is a simple and easy way to check your Linux distribution and version. To use it, open a terminal window and type the following command:

lsb_release -a

This will display information about your Linux distribution, including the distribution ID, release number, and codename. Here's an example output:

Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal

2. check /etc/os-release file

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 :

cat /etc/os-release

or you can check for anyfile that has "ease" at the end of its name:

cat /etc/*ease

The output should look something like below:

PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

3. Check the /etc/issue File

Another way to check your Linux distribution and version is to look at the contents of the /etc/issue file. This file contains information about your Linux distribution and version, as well as the kernel version.

To view the contents of the /etc/issue file, open a terminal window and type the following command:

cat /etc/issue

Here's an example output:

Ubuntu 20.04.3 LTS \n \l

4. Use the hostnamectl Command

The hostnamectl command can also be used to check your Linux distribution and version. This command displays information about your system, including the operating system and kernel version.

To use the hostnamectl command, open a terminal window and type the following command:

hostnamectl

Here's an example output:

 Static hostname: ubuntu
Icon name: computer-laptop
Chassis: laptop
Machine ID: 1234567890abcdef
Boot ID: 1234567890abcdef
Operating System: Ubuntu 20.04.3 LTS
Kernel: Linux 5.11.0-38-generic
Architecture: x86-64

5. Using the Graphical Interface

If you are using a Linux distribution with a graphical interface, you can usually check your distribution and version from the settings or system information panel. The exact location of this information may vary depending on your distribution.

Conclusion

Knowing which Linux distribution and version you're running is an important piece of information for Linux users. With the above methods, you can easily check your Linux distribution and version in just a few steps.



533 views

Previous Article Next Article

0 Comments, latest

No comments.