4 Ways to Check the CentOS Version

Being a system administrator, here are the various ways you can check the CentOS version and other crucial details of the system for troubleshooting purposes.

One of the basic things a Linux user should know for troubleshooting issues is what version or release of Linux OS is currently on the device. Several problems that you may encounter related to bugs or dependencies related errors may depend on an OS version or kernel version. Similarly, knowing the version number confirms the availability of certain features of OS and software compatibility, which makes system administration tasks very easy. In this article, we will show you different methods to determine the OS and kernel version of CentOS.

Checking the CentOS version and other details

We need to know two major things while running Linux:

  1. OS update level
  2. Running kernel version

Method 1: Check Update Level

First of all, we have to make sure that we are using the CentOS distribution of Linux. To confirm that we will look into /etc/os-release file by using below command:

$ cat /etc/os-release

Here is a sample output:

tuts@fosslinux:~ $ cat /etc/os-release
NAME="CentOS Linux"
VERSION="8 (Core)"
ID_LIKE="rhel fedora"
PRETTY_NAME="CentOS Linux 8 (Core)"


So now we are sure that we have CentOS. Next, we will look into /etc/centos-release file by using the cat command. This will show a full release version of your CentOS.

$ cat /etc/centos-release

Sample Output:

CentOS Linux release 8.2.2004 (Core)

Method 2: Using hostnamectl command

One of the simplest ways of getting CentOS version information is by using ‘hostnamectl’ command, as shown below:

$ hostnamectl

Sample Output:

Static hostname: fosslinux
         Icon name: computer-vm
           Chassis: vm
        Machine ID: gty77da6a1764e07be909d7cf65t6d66
           Boot ID: dyu34u3dc549484c8927e830e198yt56
    Virtualization: kvm
  Operating System: CentOS Linux 8 (Core)
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 4.18.0-193.x86_64
      Architecture: x86-64

Method 3: Using rpm command

You can also query ‘centos-release’ package using the rpm command to extract the full release version of CentOS:

$ rpm -qa centos-release

Sample Output:


Method 4: Using Kernel Version

Another way to find the exact CentOS version is first to get the Linux kernel version and then search that kernel version in the CentOS Wikipedia. It will show you the correct CentOS version against the kernel version. If you ask me why this method? It’s handy to know the CentOS release date, RHEL release date and other details in a table view so that you know more about your CentOS version and where it stands concerning the versions officially released.

$ uname -r

Sample Output:


Now you can copy the kernel version and search in CentOS latest version table on Wikipedia page.

centos version by kernel version
centos version by kernel version


Those were the four methods to fetch the CentOS, kernel version, and other essential details of your system. As a system administrator, these commands should be on the top of your list for troubleshooting problems.

Habib Ahmed
He is a professional writer with more than seven years of experience in the field. He also enjoys technical writing/ manuals, white papers, and scientific presentations.


Please enter your comment!
Please enter your name here





Buyers who wish to go for a machine that is based on Linux often show interest in Chromebooks due to the form factor and extended battery life capabilities. Although ChromeOS power these machines, users can still miss out on a more genuine Linux experience. For those who happen to agree, the new Lemur Pro by System76 might get some heads turning.
Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.

5 Best Music Players for Linux

For sure, there will be Linux users out there who cannot live without music. If you're one of those people, you would know how important it is to have a good music player installed on your computer system. In this article, we present to you the five Best Music Players for Linux, which will hopefully be able to satisfy each of our readers' needs.

6 Best Linux Distros for Programmers and Developers

Linux distros have long been a favorite among programmers since the rise in popularity of the OS in the nineties. Programmers are technical by nature, and Linux distros appeal to that technical nature. Let's discuss why Linux is a great desktop OS for programmers and developers, and find out best distros suitable for them.

5 Best Video Players for Linux

Most Linux-based systems come with a built-in video player, but let's be honest, it most definitely won't be able to satisfy all of your requirements, due to the fact that default software is mostly made for basic purposes. In this article, we will review the 5 Best Video Players for Linux and thoroughly discuss their features as well as their pros and cons.

Enabling GameMode on Linux for best gaming performance

GameMode is a combination of various libraries and daemons that allows all the users to improve the gaming performance on the Linux system. Developed by games publisher Feral Interactive, it improves gaming performance by requesting a group of options that will be applied temporarily to the Linux system.