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

Hướng dẫn tạo Local Yum Repository trên CentOS-7 với đĩa iso-DVD

Yum (Yellow dog Updater, Modified ) là công cụ quản lý mặc định được sử dụng trong CentOS. Thông...
30/12/2020

NextCloud – Giải pháp lưu trữ đám mây cho doanh nghiệp.

Nextcloud cung cấp đến doanh nghiệp của bạn nền tảng lưu trữ đám mây, lưu trữ một nơi xem,...
30/12/2020

Script #1 : File Integrity Monitor (FIM) – Giám sát sự thay đổi của file trên Linux

Khi sử dụng một máy chủ, ta cần theo dõi tính toàn vẹn của file. Khi file bị thay đổi ta cần...
30/12/2020
Bài Viết

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

Thuê mua proxy V6 uy tín, chất lượng tại đâu?
11/05/2024

Tổng hợp mẹo thuê mua proxy Tiktok đạt hiệu quả cao
11/05/2024

Thuê mua proxy xoay ở đâu uy tín, chất lượng, giá tốt?
11/05/2024

Nâng cao trải nghiệm trò chơi khi thuê mua proxy game tại Onet
10/05/2024

Thuê mua proxy Airdrop tốc độ nhanh, hiệu quả cực tốt
10/05/2024