Перейти к содержимому

Как узнать версию centos

  • автор:

4 Ways to Check CentOS or RHEL Version

Do you know the version of CentOS/RHEL release you are running on your server? Why is this even important? There are several reasons to keep this information in mind: to quickly gather information about your system; keep up with bug fixes and security updates, and configure correct software repositories for a specific release, among others.

This is probably an easy task for experienced users, but it’s not usually the case for newbies. In this article, we will show how to check the version of CentOS or RHEL Linux installed on your server.

How to Check Linux Kernel Version in CentOS

Knowing the kernel version is just as important as knowing the distro release version. To check Linux kernel version, you can use the uname command.

Check Kernel Version in CentOS

From the output of the above command, the CentOS is powered by an old kernel version, to install or upgrade to the latest kernel release, follow the instructions in our article: How to Install or Upgrade to Kernel 4.15 in CentOS 7.

How to Check CentOS or RHEL Release Version

CentOS release version numbers have two parts, a major version such as “6” or “7” and a minor or update version, such as or “6.x” or “7.x”, which correspond to the major version and update set of RHEL receptively, used to build a particular CentOS release.

To elaborate more in this, take for instance CentOS 7.5 is built from the source packages of RHEL 7 update 5 (also known as RHEL version 7.5), which is referred to as a “point release” of RHEL 7.

Let’s take a look at these 4 useful ways to check CentOS or RHEL release version.

1. Using RPM Command

RPM (Red Hat Package Manager) is a popular and core package management utility for Red Hat based systems like (RHEL, CentOS and Fedora), using this rpm command, you will get your CentOS/REHL release version.

Check CentOS Version Using RPM Command

2. Using Hostnamectl Command

hostnamectl command is used to query and set Linux system hostname, and show other system related information, such as operating system release version as shown in the screenshot.

Check CentOS Version Using hostnamectl Command

3. Using lsb_release Command

lsb_release command displays some LSB (Linux Standard Base) and distribution information. On CentOS/REHL 7, the lsb_release command is provided in the redhat-lsb package which you can install it.

Once you have installed it, you can check your CentOS/REHL version as shown.

Show CentOS Version

4. Using Distro Release Files

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

Check CentOS Release Version

That’s all for now! If you know any other method that should be covered here, let us know via the comment form below. You can also ask any questions related to the topic.

Tutorial Feedback.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

How to Check CentOS Version?

Home » SysAdmin » How to Check CentOS Version?

There are many reasons why you should know the CentOS version you are running. For example, if you are troubleshooting a system issue, you will want to know.

Also, it’s useful to ensure your Linux operating system is up-to-date. Outdated software can cause serious security risks and vulnerabilities.

In this tutorial, discover four different options on how to check CentOS version.

Instructions on how to check your CentOS version

  • System running CentOS
  • Access to a terminal window/command line (Ctrl-Alt-F2)

How to Check CentOS Version From Command Line

lsb Command to Display Details of CentOS Linux Release

LSB (Linux Standard Base) is a joint project of several Linux distributions to standardize software system structure. One of the commands available from the command line lsb_release . The output will indicate which OS version you are running.

1. Before you can use lsb commands, you have to install the package first. Use the following command:

2. Type in your sudo password to authorize the installation and then press y and Enter to confirm.
3. View CentOS version information with the command:

Find CentOS Version with the hostnamectl Command

CentOS version 7 and above has the hostnamectl command, which can query and change the hostname and other related settings. It displays information from the /etc/centos-release file, uname –a file and others.

In addition to version number, it indicates which Linux kernel your system is using.

To see these specifics, use the command:

example of centos version number and output

Find CentOS Version with RPM

RPM is a free and open-source package manager created for Red Hat Linux and its related distributions.

With the rpm command, you can find out the full package name and the release version of CentOS you are running.

Use the command:

Example of RPM command to view version of CentOS

Check CentOS Version in Release File

To check which Linux distro and major release version you have installed, open the release file using the command:

The output reveals the name of the operating system, its major release version, and other specifics, as displayed in the image below.

example of Centos command output for operating system and release version

To see the full release version, use the command:

The output reveals the full release version of your operating system, including the:

  • Major release number
  • Minor release number
  • Asynchronous release number

example of major, minor and Asynchronous release number

Check Linux Kernel Version in CentOS

Knowing the kernel version you are running is often as useful as finding the release version.

Find out which Linux kernel version you running, with the uname command:

The output you receive is the version number of the kernel of your operating system.

In the example displayed below, 3.10.0.957.

example of linux kernel version displayed in CentOS

This article details 4 ways to check CentoOS version installed. Also, you now know how to check the Linux kernel version. To learn how to check the version of other Red Hat based Linux operating systems check our guide on “Check Linux Red Hat (RHEL) Version“.

If you discover you are not using the latest stable version, read our guide on how to update CentOS!

Как узнать версию CentOS 7

Вам может понадобиться версия установленной операционной системы, когда нужно решить какую-нибудь проблему с дистрибутивом или когда вы оставляете на форуме вопрос о том, как что-то настроить.

В этой статье мы рассмотрим, как узнать версию CentOS 7, посмотреть уровень обновлений, а также узнать версию ядра, которая сейчас используется. Инструкция написана для CentOS 7, однако она подойдёт и для более ранних версий дистрибутива, так как файлы, содержащие основную информацию, одинаковы во многих версиях.

Как узнать версию CentOS 7

Основная информация о дистрибутиве и его версии хранится в этих четырёх файлах:

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

В моём случае это CentOS 7.6.1810:

У CentOS 7 на данный момент используется rolling-система обновления, это значит, что при выходе новой версии вам не нужно переустанавливать систему, а достаточно только обновить её штатной утилитой yum. Но это только в рамках седьмой версии. Поэтому важно не только то, что это CentOS 7, но и остальные цифры имеют значение. В остальных файлах тоже находится подобная информация:

cat /etc/redhat-release cat /etc/system-release

В файле /etc/os-release хранится только информация о том, что это седьмая версия CentOS 7:

Все эти четыре файла принадлежат к пакету centos-release. Поэтому вы можете узнать версию дистрибутива, ещё и посмотрев версию этого пакета:

rpm -qf /etc/redhat-release

Версию CentOS и версию ядра можно посмотреть с помощью утилиты hostnamectl:

Ещё один способ посмотреть версию CentOS — это утилита lsb_release. Она находится в пакете redhat-lsb и по умолчанию не установлена. Для её установки выполните:

yum install redhat-lsb

Затем можно выполнить команду:

Для просмотра полной информации используйте опцию -a:

Как посмотреть версию ядра в CentOS 7

Как и в других дистрибутивах, в CentOS для просмотра информации о ядре используется утилита uname. Для просмотра всей доступной информации используйте опцию -a:

Для просмотра только версии ядра укажите опцию -r:

А чтобы узнать дату и время компиляции ядра, выполните:

Выводы

В этой небольшой статье мы разобрали, как посмотреть версию CentOS 7 различными способами. А какие ещё способы вы знаете для просмотра версии дистрибутива? Напишите в комментариях!

How to determine CentOS version?

How do I determine the version of a CentOS server without access to any graphical interface? I’ve tried several commands:

but which one is correct: 4.1.2-4 from /proc/version or 5.3 from /etc/issue ?

10 Answers 10

In cases like CentOS the actual version is usually placed in /etc/*elease .

granted this file usually holds the version of the entire OS minus the kernel (since you can choose which to load). This file will have the same information as /etc/issue but with CentOS instead of RedHat

As you can see in /etc/issue , you’re using CentOS 5.3. (It says Red Hat because CentOS is based upon the RH sources, and some software checks /etc/issue to identify the distro in use; thus, they’d fail if this was changed to CentOS).

The 4.1.2-4 in /proc/version refers to the version of the gcc C compiler used to build the kernel.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Luxury Car Rental in Miami | Reserve a Premium Vehicle with RealCar