How to know the version of CentOS 7

You may need version of your operating system when you need to solve some problem with Windows or when you leave a question on the forum about how to configure anything.

In this article, we’ll look at how to know the version of CentOS 7, to see the level of updates, as well as to know the kernel version, which is now used. The instructions are written for CentOS 7, but it will be suitable for earlier versions of the distribution files containing the basic information is the same in many versions.

How to know the version of CentOS 7

Basic information about the distribution and its version are stored in these four files:

  • /etc/centos-release
  • /etc/os-release
  • /etc/redhat-release
  • /etc/system-release

In my case it is CentOS 7.6.1810:

cat /etc/centos-release

Have CentOS 7 currently used rolling-upgrade system, this means that when a new release you do not need to reinstall the system, but rather only update it regular utility yum. But it is only in the seventh version. It is therefore important not only that this is CentOS 7, but other numbers matter. In the rest of the files too, is this information:

cat /etc/redhat-release

cat /etc/system-release

In the file /etc/os-release is only stored the information that this is the seventh version of CentOS 7:

cat /etc/os-release

All these four files belong to the package centos-release. So you can recognize the version of the distribution, even seeing the version of this package:

rpm-qf /etc/redhat-release

The CentOS version and kernel version can be viewed using a utility hostnamectl:


Another way to see the version of CentOS is a utility lsb_release. It is in the package redhat-lsb and not installed by default. To install it run:

yum install redhat-lsb

You can then run the command:

lsb_release -d

To view the full information, use the-a option:

lsb_release -a

How to see kernel version in CentOS 7

As in other distros, in CentOS to view information about the core network, use the uname. To view all available information, use the-a option:


To view only the kernel, specify the-r option:


And to find out the date and time the kernel compilation, run:

uname -v


In this small article we discussed how to see the version of CentOS 7 in a variety of ways. What other ways do you know to view the version of the distribution? Write in the comments!


(Visited 31 times, 1 visits today)