How to Check Version of CentOS

29/12/2020
Red Hat Enterprise Linux or RHEL in short is a commercial Linux based operating system. RHEL provides paid support for its customers. While most of the softwares used in RHEL is the same as the standard versions of these software found in other Linux distributions such as Ubuntu/Debian, RHEL only gives support for these software.

A commercial Linux distribution like RHEL is very stable as only old, stable and thoroughly tested software are distributed. RHEL also has long term support for all its releases. So it is ideal for small, medium and big companies and institutions.

CentOS is another Linux distribution which has the same codebase as RHEL and is freely distributed. It’s free to download and use. The only downside is that it does not have paid support. Basically you are responsible for fixing any problem you may have with your operating system. You can’t ask Red Hat or CentOS to fix them for you. So CentOS is RHEL without paid support.

There are many version of CentOS available, for example, CentOS 5, CentOS 6, CentOS 7. CentOS 7 is the latest version of CentOS and it is based on RHEL 7. CentOS 6 is an earlier version of CentOS which is based on RHEL 6, and is still supported till November 30, 2020 according to the official website of CentOS at the time of this writing. CentOS 5 and earlier is at the EOL (End of Life) and you will not get any updates or bug fixes any more.

Since you will have to fix all the problems you face while using CentOS, the version of CentOS you’re using is a must have knowledge. If you can’t tell which version of CentOS you’re using, getting help from online forums and other places would be really hard for you.

You will also need to know which version of CentOS you’re using while installing new software. For example, NodeJS has packages for CentOS 6 and CentOS 7. To install it on CentOS 6, you must follow the procedures for CentOS 6 given on the official website of NodeJS. To install it on CentOS 7, you will be following instructions for CentOS 7 the same way. Otherwise things won’t work as expected.

Now you can tell how important it is to actually know the version of CentOS you’re using. In this article, I will show you ways of checking version of your CentOS operating system. Let’s get started.

Using the cat Command:

The CentOS release information is stored in the /etc/redhat-release file on CentOS and RHEL. The easiest way to check CentOS version is to read that file with the following command:

$ cat /etc/redhat-release

As you can see, the version information is printed. I am using CentOS 7.4.

Using lsb_release Command:

You can check CentOS version with the widely used lsb_release command as well. But there is a slight problem with this command on CentOS and RHEL operating systems. The command is not available by default. Because, on CentOS and RHEL systems, the redhat-lsb-core package is not installed.

You can easily install it with the following command:

$ sudo yum install redhat-lsb-core -y

The package should be installed.

Now run the following command to check version of your CentOS operating system:

$ lsb_release -a

As you can see, the correct CentOS version is printed. I am using CentOS 7.4.

So that’s how you check the version of your CentOS operating system. Thank you for reading this article.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

[CentOS 8] Hướng dẫn cấu hình IP tĩnh trong CentOS 8

Sau khi cài đặt Linux System, một trong các bước đầu tiên mà bất cứ người dùng nào kể cả...
30/12/2020

CLI #3: Giới thiệu lệnh chattr để bảo vệ sự toàn vẹn của file

Đối với Linux, thông thường chúng ta sử dụng phân quyền bằng lệnh chmod để bảo vệ tập tin....
30/12/2020

Cài đặt phpMyAdmin sử dụng Nginx trên CentOS 7

Cài đặt 1. Trong kho lưu trữ repositories của RHEL 7.0 hoặc CentOS 7.0 không cung cấp gói cài đặt PhpMyAdmin,...
25/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

Dịch Vụ Xây Dựng Hệ Thống Peering Với Internet Exchange (IXP)
04/04/2025

Dịch Vụ Triển Khai VPN Site-to-Site & Remote Access
04/04/2025

Dịch Vụ Thiết Lập Hệ Thống Tường Lửa (Firewall)
04/04/2025

Dịch Vụ Triển Khai Hệ Thống Ảo Hóa & Cloud
04/04/2025

Dịch Vụ Triển Khai Hệ Thống Ceph
04/04/2025