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:

    # cat /proc/version
    Linux version 2.6.18-128.el5 ([email protected])
    (gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) …
    # cat /etc/issue
    Red Hat Enterprise Linux Server release 5.3 (Tikanga)

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

  • Renan

    Renan Correct answer

    8 years ago

    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.

    I'll just add, what You could use uname -a to detect, if it 32 or 64 bit compatible.

    On CentOS 7, 'cat /etc/issue' yields gobbledygook: `\S Kernel \r on an \m`

    Correct answer should be the one by h3rrmiller... `cat /etc/*elease`. `/etc/issue` is often replaced by an organisation's MOTD/disclaimer

    The `/etc/issue` file shows that it is RHEL, not CentOS.

License under CC-BY-SA with attribution

Content dated before 6/26/2020 9:53 AM