Linux which centos version

Содержание
  1. Как проверить версию CentOS
  2. How to Check your CentOS Version
  3. В этом руководстве мы покажем несколько разных команд, как проверить, какая версия CentOS установлена ​​в вашей системе.
  4. Проверьте версию CentOS из командной строки
  5. Альтернативные методы проверки версии CentOS
  6. Проверьте версию CentOS с помощью rpm команды
  7. Проверить версию CentOS с помощью /etc/centos-release файла
  8. Проверьте свою версию CentOS с помощью /etc/os-release файла
  9. Проверьте свою версию CentOS с помощью hostnamectl команды
  10. Вывод
  11. 4 Ways to Check CentOS Version in Linux Command Line
  12. How to Check CentOS Version
  13. 7.14.1234
  14. Method 1: Using hostnamectl
  15. Method 2: Using rpm package manager
  16. Method 3: Refer the files /etc/*release
  17. Method 4: Using lsb_release tool
  18. How to Check CentOS Version
  19. 1. Check the CentOS/RHEL OS Update Level
  20. 2. Check the Running Kernel version
  21. Checking CentOS 7 version
  22. Checking the LSB version
  23. Check OS version with GRUB configuration files
  24. CentOS 7 Example
  25. 4 способа проверки версии CentOS в командной строке Linux
  26. Как проверить версию CentOS
  27. 7.14.1234
  28. Метод 1: Использование hostnamectl
  29. Способ 2: Использование диспетчера пакетов rpm
  30. Способ 3: см. Файлы /etc/*release
  31. Способ 4: Использование инструмента lsb_release

Как проверить версию CentOS

How to Check your CentOS Version

В этом руководстве мы покажем несколько разных команд, как проверить, какая версия CentOS установлена ​​в вашей системе.

Когда вы впервые входите в систему на машине CentOS, прежде чем выполнять какие-либо действия, вы можете проверить, какая версия CentOS работает в вашей системе.

На момент написания CentOS Linux имеет три основных активных выпущенных ветки: CentOS 5, CentOS 6 и CentOS 7.

Проверьте версию CentOS из командной строки

Команда lsb_release отображает информацию о вашем дистрибутиве Linux Standard Base (LSB).

Это предпочтительный метод, и он должен работать независимо от того, какую версию CentOS вы используете.

Откройте свой терминал и введите следующую команду:

Ваша версия CentOS будет отображаться в строке описания. Как видно из вывода выше, я использую CentOS Linux версии 7.5.1804.

Что означает номер версии 7.5.1804 ?

  • 7 это основная ветвь CentOS.
  • 7.5 это последняя минорная версия CentOS 7.
  • 1804 — это код даты дополнительной версии, 1804 означает апрель 2018 года. Этот номер используется для обозначения даты выпуска.

Альтернативные методы проверки версии CentOS

Проверьте версию CentOS с помощью rpm команды

rpm (Red Hat Package Manager) — это инструмент управления пакетами для систем на базе Red Hat, таких как RHEL, CentOS и Fedora.

Вы можете использовать инструмент rpm для отображения информации о centos-release пакете, который включает версию CentOS в своем названии:

Проверить версию CentOS с помощью /etc/centos-release файла

centos-release Пакет содержит /etc/centos-release файл.

Чтобы найти свою версию CentOS, введите следующую команду:

Проверьте свою версию CentOS с помощью /etc/os-release файла

/etc/os-release Файл присутствует на всех системах , работающих под управлением Systemd и содержит действующие идентификационные данные системы.

Этот метод будет работать, только если у вас CentOS 7:

Проверьте свою версию CentOS с помощью hostnamectl команды

hostnamectl — это команда, которая позволяет вам установить системное имя хоста , но вы также можете использовать ее, чтобы найти свою ветку CentOS.

Этот метод будет работать, только если у вас CentOS 7:

Вывод

Для получения дополнительной информации о выпусках CentOS посетите страницу Wiki, посвященную выпускам CentOS .

Источник

4 Ways to Check CentOS Version in Linux Command Line

CentOS is a great OS when comes to server software because they have longer support cycle and great stable software in the repositories and a larger community. To know more about why CentOS is better, check out this page.

Читайте также:  Файловая система семейств ос windows

It happens most of the time when installing or selecting a software package, one needs to know the version of the CentOS running in their systems to avoid dependency mismatch and other issues.

In this tutorial, I’ll show you some ways by which you can check the version of the CentOS.

How to Check CentOS Version

To check CentOS version, you can use a command like this:

The result will give you the CentOS version number.

Before we see other methods to check CentOS version, let’s first understand the version number and what those number means.

CentOS version consists of three parts, which can be best understood with an example. Consider the version:

7.14.1234

  • 7-major release: This is the most important version number because software packages developed for one version may not be supported in other versions. This is because newer versions will have some bugs fixed which are not in new versions and also they will have new features, new packages, and new hooks into the system. So, there will be a problem when running the software intended for other versions and hence can mess up the system.
  • 14-minor release: These are less important, but they are crucial for maintaining major security updates and a few new features.
  • 1234-build number: This is a version for distributing the software with minor security updates and bug fixes. This doesn’t affect the software versions running on the system that much.

Method 1: Using hostnamectl

The hostnamectl command can be used to query and set the hostname for the system. I also display the Version number of the OS running in the system. This Command displays only the major version number.

Your output will be similar to like the one below.

hostnamectl displays the major version number

Method 2: Using rpm package manager

Since os itself considered as a package by most package managers one can query the package manager(rpm in this case) to find the version of the OS.

  • rpm is the package manager
  • -q or –-query is the option for querying
  • centos-release is the package that we want to query on

Note: If you need to check any other software replace centos-release with

Result of the above will be similar to the one below:

rpm command to query the system for version info

Method 3: Refer the files /etc/*release

Every Linux OS hosts teh important and configuration details about itself and packages in /etc/ directory. And so does centOS.

If you issue ls /etc/*release , following files will be listed.

  • centos-release
  • os-release
  • redhat-release
  • system-release

One can guess by the name of the files, they carry information about the system release. You can manually open the files using any text editor and examine the files for version information or cat command can be used to see the contents of the files. If you don’t know what is cat or you want to brush up your cat skills, Check out this detailed guide on using cat command.

Result of the command will be similar to below:

examine /etc/*release files for version information

Method 4: Using lsb_release tool

lsb release command displays important lsb (linux standard base) information and distribution information. But this tool is available inside the package redhat-lsb.

Install the package in your system using the below command to continue (if you don’t have already).

Читайте также:  Нарушена целостность файлов windows

As you might have noticed, you need to be a sudoer for running this command as you are installing a package. If you are a sudoer and you want to give someone sudoer rights, learn how to create sudo user. If you are not a sudoer, try contacting your system admin.

After installing the package, run the below command:

  • -d is the option to display a description of the OS

The result will be similar to the one below:

using lsb_release to find version information

This lsb_release command can be used in other distributions as well. For example, you can run it in Debian to check the Debian version.

Congratulations!. By now, you know various ways by which version number of the CentOS can be found.

I hope you found this article useful. If you have any suggestions or comments, feel free to drop them below.

Источник

How to Check CentOS Version

Knowing the exact kernel version or OS version is sometimes necessary while troubleshooting an issue or providing information to the support team. This post will assist you to determine the OS and kernel version of the CentOS or RHEL system you are running.

There are 2 major things to check when it comes to finding the version of any Linux system. They are
1. Check the OS Update Level
2. Check the running kernel version

1. Check the CentOS/RHEL OS Update Level

The 4 files shown below provides the update version of the CentOS/Redhat OS.

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

The content of each of the above files from a CentOS 7.4 system is shown below.

The above 4 files are provided by the package centos-release.

You can find out release information by checking the versioning reported the rpm database. For example:

2. Check the Running Kernel version

You can find out which CentOS kernel version and architecture you are using with the uname command. Do “man uname” for details of the uname command.

Check kernel compile time (uname -v) and compare with known value:

You can also Verify the kernel package using the rpm command. The command would produce an output only if there is any issue with the installed kernel.

Checking CentOS 7 version

Apart from all the above commands, you can also use the command “hostnamectl” to find OS version information in CentOS 7 systems. For example:

Checking the LSB version

Another way to check the centOS version is using the “lsb_release” command. The lsb_release command is provided by the package “redhat-lsb”. This package may not be present by default on the system and you may need to install it first.

Examples of lsb_release command:

Check OS version with GRUB configuration files

Using the GRUB configuration file is not a recommended way of checking the OS version, but I would still like to mention this method here for your information. Search for the “menuentry” (For CentOS 7) and “title” (For CentOS 6) in the GRUB configuration file to find the OS version.

CentOS 7 Example

In case of CentOS 7, you can also get the current kerel version from the file /boot/grub2/grubenv. For example:

Источник

4 способа проверки версии CentOS в командной строке Linux

Главное меню » Операционная система Linux » 4 способа проверки версии CentOS в командной строке Linux

Читайте также:  The nokia lumia 510 windows phone

Краткая информация. В этой статье объясняется несколько способов проверки версии дистрибутива CentOS Linux на вашем компьютере.

C entOS – отличная ОС, серверное программное обеспечение, где более длительный цикл поддержки и отличное стабильное программное обеспечение в репозиториях и более крупное сообщество.

Это происходит в большинстве случаев при установке или выборе программного пакета, нужно знать версию CentOS, работающую в своих системах, чтобы избежать несоответствия зависимостей и других проблем.

В этой статье мы покажем вам несколько способов, которыми вы можете проверить версию CentOS.

Как проверить версию CentOS

Прежде чем мы увидим методы проверки версии CentOS, давайте сначала рассмотрим номер версии и то, что означает это число.

Версия CentOS состоит из трех частей, это лучше всего понять на примере. Рассмотрим версию:

7.14.1234

  • 7 – разрядный выпуск: это самый важный номер версии, поскольку пакеты программного обеспечения, разработанные для одной версии, могут не поддерживаться в других версиях. Это связано с тем, что в новых версиях будут исправлены некоторые ошибки, которые не входят в новые версии, а также будут иметь новые функции, новые пакеты и новые перехватчики в систему. Таким образом, возникнет проблема при запуске программного обеспечения, предназначенного для других версий, и, следовательно, может испортить систему
  • 14 – младший релиз: менее важен, имеет решающее значение для поддержания основных обновлений безопасности и нескольких новых функций.
  • 1234 – версия сборки: Это версия для распространения программного обеспечения с незначительными обновлениями безопасности и исправлениями ошибок. Это не сильно влияет на версии программного обеспечения, запущенные в системе.

Метод 1: Использование hostnamectl

Команда hostnamectl может использоваться для запроса и установки имени хоста для системы. А также показывает номер версии ОС, запущенной в системе. Эта команда отображает только номер основной версии.

Способ 2: Использование диспетчера пакетов rpm

Поскольку сама OS рассматривается как пакет для большинства менеджеров пакетов, можно запросить диспетчер пакетов (rpm в этом случае), чтобы найти версию ОС.

  • rpm – менеджер пакетов
  • -q или – -query – это опция для запросов
  • centos-release – это пакет, который мы хотим запросить

Способ 3: см. Файлы /etc/*release

Каждая ОС Linux содержит важные и конфигурационные данные о себе и пакетах в каталоге /etc/. И то же, что и в CentOS.

Если вы укажете ls /etc/*release , будут перечислены следующие файлы.

  • centos-release
  • os-release
  • redhat-release
  • system-release

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

Способ 4: Использование инструмента lsb_release

Команда lsb release отображает важную информацию и информацию о распространении lsb ( linux standard base). Но этот инструмент доступен внутри пакета redhat-lsb. Установите пакет в своей системе, используя следующую команду, чтобы продолжить (если вы еще этого не сделали).

Как вы могли заметить, вам нужно быть sudoer для запуска этой команды при установке пакета. Если вы являетесь sudoer и хотите дать кому-то права sudoer, ознакомьтесь с этой статьей. Если вы не sudoer, попробуйте связаться с администратором системы.

После установки пакета выполните следующую команду:

  • -d – возможность отображения описания ОС

Поздравляем! Вы дошли до конца. К настоящему времени вы знаете различные способы, с помощью которых можно найти номер версии CentOS.

Надеюсь, вы нашли эту статью полезной. Если у вас есть какие-либо предложения или комментарии, не стесняйтесь предложить их ниже.

Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.

Источник

Оцените статью