Home Linux ServerLinux Fundementals 4 ways to check the version of CentOS in use

4 ways to check the version of CentOS in use

by Thạch Phạm
Published: Last Updated on

In today’s article, AZDIGI will help you check the version of CentOS being used, which will make it easier for you to manage your CentOS server.

I. Introduction

Do you know the release version of CentOS that you are running on your server? Why is this important?

There are several reasons that you need to keep in mind your CentOS version information:

  • To quickly gather information about your system.
  • The commands used for each CentOS version will be different.
  • Update bug fixes and security updates, as well as configure the correct software repositories for a specific release, among other releases.
  • Install software based on the CentOS version you are using.

This may be a relatively easy task for experienced users, but a guide will be needed for new users. In this article, AZDIGI will guide you on how to check the CentOS version installed on your server.

II. Check the Linux Kernel version on CentOS

Before we move on to checking the CentOS version, we also need to know that the Kernel version is equally important. To check the Linux Kernel version, you can use the “uname” command as follows.

AZDIGI Tutorial
uname -or
uname -a

Here is the Kernel version on my server is using:

The version of Linux Kernel in use is 3.10.0.

From the output of the above command, CentOS is provided by the old Kernel version. To install or upgrade to the latest Kernel release, follow the instructions in my following article:

III. Check the CentOS version

The CentOS release version will have two parts, a major release version like “6”, “7”, or “8” and a minor or updated version, such as “6.x” or “7.x”, “8”.

There are 4 ways we can check the CentOS version. But first, we need to SSH or access your VPS or server as root or at least with a user with sudo permission. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:

After successfully SSH as root, let’s go through the ways to check the CentOS version.

Method 1: Use the RPM command

RPM (RedHat Package Manager) is a popular and core package management utility for RedHat-based systems (RHEL, CentOS, and Fedora). By using the rpm command, you will get your CentOS release version.

Use the RPM command to check the CentOS version.

Method 2: Use the Hostnamectl command

The hostnamectl command is used to query and set the hostname of a Linux system, and also displays information about the system such as the operating system release version and kernel version as shown below:

Use the “hostnamectl” command to check the CentOS version.

Method 3: Use the “lsb_release” command

The “lsb_release” command will display some LSB (Linux Standard Base) and distribution information. On CentOS, the “lsb_release” command is provided in the “redhat-lsb” package that you can install with the following command:

AZDIGI Tutorial
yum install redhat-lsb -y

After the installation is complete, we continue to use the following command to check the CentOS version.

AZDIGI Tutorial
lsb_release -d

Method 4: Using release files on the system

All the commands above retrieve OS release information from certain system files. You can directly view the contents of these files using the cat command.

AZDIGI Tutorial
[Trên CentOS]
cat /etc/centos-release    

[Trên RHEL]
cat /etc/redhat-release   
cat /etc/system-release

[Xem thêm nhiều thông tin khác]
cat /etc/os-release 		

IV. Summary

So we have completed 4 ways to check the CentOS version.

Wishing you success! See more useful articles about Linux VPS at the following link:

If you need assistance, you can contact support in the ways below:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign