Nội dung
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.
uname -or Hoặc uname -a
Here is the Kernel version on my server is using:
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.
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:
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:
yum install redhat-lsb -y
After the installation is complete, we continue to use the following command to check the CentOS version.
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.
[Trên CentOS] cat /etc/centos-release [Trên RHEL] cat /etc/redhat-release Hoặc 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:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com .