{"id":30209,"date":"2021-01-18T03:34:36","date_gmt":"2021-01-17T19:34:36","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&p=30209"},"modified":"2022-09-07T20:03:25","modified_gmt":"2022-09-07T12:03:25","slug":"linux-os-centos-version","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/linux-os-centos-version","title":{"rendered":"Linux OS: CentOS Version"},"content":{"rendered":"\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t

Linux OS: CentOS Version<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

The latest CentOS<\/a> version is\u00a0CentOS7 (version\u00a0<\/strong>7.7.1511)<\/strong><\/p>

However, here are the others CentOS version under support: CentOS 6 (version 6.6.8)\u00a0\u00a0End Of Life (EOL) CentOS; CentOS 5 \u2014 version 5.5.11\u00a0 \u2013> 31st March 2017; CentOS 4 \u2014 version 4.4.9\u00a0\u00a0\u00a0 \u2013>\u00a0 29th February 2012<\/p>

For more information, kindly visit our Linux VPS<\/a> page or contact<\/a> our support team.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t

8 Ways to Check CentOS Version<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

Before starting to learn about how to check CentOS version, you should know that CentOS version consists of three parts, which are:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t
  1. Major Version<\/strong>: Major release version number<\/li>
  2. Minor Version<\/strong>: Minor release version number<\/li>
  3. Monthstamp<\/strong>: codebase month and year timestamp<\/li><\/ol>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t

    1. \/etc\/centos-release file<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t\t\t

    There are CentOS release and version details in the CentOS specific file.<\/p>

    [root@centos ~]<\/code># cat \/etc\/centos-release<\/code><\/div>
    CentOS Linux release 8.1.1911 (Core) <\/code><\/div>
    [root@centos ~]<\/code># <\/code><\/div><\/div><\/td><\/tr><\/tbody><\/table><\/div><\/div>
    • Major Version: 8<\/li>
    • Minor Version: 1<\/li>
    • Monthstamp: 1911 i.e. November 2019.<\/li><\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Linux\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      Centos Release Version<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

      \n\t\t\t\t
      \n\t\t\t

      2. \/etc\/system-release file<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      This file also contains the same information as the centos-release file.<\/p>

      [root@centos ~]<\/code># cat \/etc\/system-release<\/code><\/div>
      CentOS Linux release 8.1.1911 (Core) <\/code><\/div>
      [root@centos ~]<\/code>#<\/code><\/div><\/div><\/td><\/tr><\/tbody><\/table><\/div><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      3. \/etc\/os-release file<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      This file contains the Linux OS information. So, you can get the major version number from this file.<\/p>

      [root@centos ~]<\/code># cat \/etc\/os-release<\/code><\/div>
      NAME=<\/code>\"CentOS Linux\"<\/code><\/div>
      VERSION=<\/code>\"8 (Core)\"<\/code><\/div>
      ID=<\/code>\"centos\"<\/code><\/div>
      ID_LIKE=<\/code>\"rhel fedora\"<\/code><\/div>
      VERSION_ID=<\/code>\"8\"<\/code><\/div>
      PLATFORM_ID=<\/code>\"platform:el8\"<\/code><\/div>
      PRETTY_NAME=<\/code>\"CentOS Linux 8 (Core)\"<\/code><\/div>
      ANSI_COLOR=<\/code>\"0;31\"<\/code><\/div>
      CPE_NAME=<\/code>\"cpe:\/o:centos:centos:8\"<\/code><\/div>
      HOME_URL=<\/code>\"https:\/\/www.centos.org\/\"<\/code><\/div>
      BUG_REPORT_URL=<\/code>\"https:\/\/bugs.centos.org\/\"<\/code><\/div>
      \u00a0<\/div>
      CENTOS_MANTISBT_PROJECT=<\/code>\"CentOS-8\"<\/code><\/div>
      CENTOS_MANTISBT_PROJECT_VERSION=<\/code>\"8\"<\/code><\/div>
      REDHAT_SUPPORT_PRODUCT=<\/code>\"centos\"<\/code><\/div>
      REDHAT_SUPPORT_PRODUCT_VERSION=<\/code>\"8\"<\/code><\/div>
      \u00a0<\/div>
      [root@centos ~]<\/code>#<\/code><\/div><\/div><\/td><\/tr><\/tbody><\/table><\/div><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      4. \/etc\/redhat-release file<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      CentOS is built on top of RedHat Linux distribution. Besides, this file also contains the same information as the centos-release file.<\/p>

      [root@centos ~]<\/code># cat \/etc\/redhat-release<\/code><\/div>
      CentOS Linux release 8.1.1911 (Core) <\/code><\/div>
      [root@centos ~]<\/code>#<\/code><\/div><\/div><\/td><\/tr><\/tbody><\/table><\/div><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      5. lsb_release command<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      This command doesn\u2019t come pre-installed with the CentOS server. However, you can install it using the following command.<\/p>

      [root@centos ~]<\/code># yum install redhat-lsb<\/code><\/div><\/div><\/td><\/tr><\/tbody><\/table><\/div><\/div>

      Then, check the CentOS version using the following command.<\/p>

      [root@centos ~]<\/code>#\u00a0 lsb_release -d<\/code><\/div>
      Description:\u00a0\u00a0\u00a0 CentOS Linux release 8.1.1911 (Core) <\/code><\/div>
      [root@centos ~]<\/code>#<\/code><\/div><\/div><\/td><\/tr><\/tbody><\/table><\/div><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      6. rpm query<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      Besides using the command above, we can query the rpm package manager to get the CentOS version information.<\/p>

      [root@centos ~]<\/code># rpm -q centos-release<\/code><\/div>
      centos-release-8.1-1.1911.0.8.el8.x86_64<\/code><\/div>
      [root@centos ~]<\/code>#<\/code><\/div><\/div><\/td><\/tr><\/tbody><\/table><\/div><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      7. rpm macro<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      Here is a simple rpm macro evaluation to get the CentOS major version.<\/p>

      [root@centos ~]<\/code># rpm -E %{rhel}<\/code><\/div>
      8<\/code><\/div>
      [root@centos ~]<\/code>#<\/code><\/div><\/div><\/td><\/tr><\/tbody><\/table><\/div><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t

      8. hostnamectl command<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
      \n\t\t\t\t
      \n\t\t\t\t\t\t\t

      Next, the hostnamectl command can be used to get the system information. Also, it reveals the Operating System version.<\/p>

      [root@centos ~]<\/code># hostnamectl<\/code><\/div>
      \u00a0\u00a0\u00a0<\/code>Static <\/code>hostname<\/code>: localhost.localdomain<\/code><\/div>
      Transient <\/code>hostname<\/code>: li1176-240.members.linode.com<\/code><\/div>
      \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code>Icon name: computer-vm<\/code><\/div>
      \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code>Chassis: vm<\/code><\/div>
      \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code>Machine ID: c2a4bfa7e0c74457b3a978656ab959e8<\/code><\/div>
      \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code>Boot ID: c89bae2d3ec7493987a455bfa15e4818<\/code><\/div>
      \u00a0\u00a0\u00a0\u00a0<\/code>Virtualization: kvm<\/code><\/div>
      \u00a0\u00a0<\/code>Operating System: CentOS Linux 7 (Core)<\/code><\/div>
      \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code>CPE OS Name: cpe:<\/code>\/o<\/code>:centos:centos:7<\/code><\/div>
      \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code>Kernel: Linux 3.10.0-1062.12.1.el7.x86_64<\/code><\/div>
      \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code>Architecture: x86-64<\/code><\/div>
      [root@centos ~]<\/code># <\/code><\/div>
      [root@centos ~]<\/code># <\/code><\/div>
      [root@centos ~]<\/code># hostnamectl | grep \"Operating System\"<\/code><\/div>
      \u00a0\u00a0<\/code>Operating System: CentOS Linux 7 (Core)<\/code><\/div>
      [root@centos ~]<\/code># <\/code><\/div><\/div><\/td><\/tr><\/tbody><\/table><\/div><\/div>

      Are you wondering why this command is printing CentOS 7, whereas others are printing CentOS 8?<\/strong><\/p>

      Well, it\u2019s because the hostnamectl<\/strong> command doesn\u2019t work in Docker containers. This command output is from my own VPS machine. The other commands output is from my local Docker CentOS 8 container<\/strong>.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"

      Linux OS: CentOS Version The latest CentOS version is\u00a0CentOS7 (version\u00a07.7.1511) However, here are the others CentOS version under support: CentOS 6 (version 6.6.8)\u00a0\u00a0End Of Life (EOL) CentOS; CentOS 5 \u2014 version 5.5.11\u00a0 \u2013> 31st March 2017; CentOS 4 \u2014 version 4.4.9\u00a0\u00a0\u00a0 \u2013>\u00a0 29th February 2012 For more information, kindly visit our Linux VPS page or […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[109],"kbtag":[106,105],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/30209"}],"collection":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/comments?post=30209"}],"version-history":[{"count":37,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/30209\/revisions"}],"predecessor-version":[{"id":38116,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/30209\/revisions\/38116"}],"wp:attachment":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/media?parent=30209"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=30209"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtag?post=30209"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=30209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}