51

When I run cat /proc/version command in terminal, I got below output:

Linux version 2.6.18-348.1.1.0.1.el5 (mockbuild@ca-build56.us.oracle.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP Tue Jan 22 16:39:05 PST 2013

If I run lsb_release -a command, I can see below information:

LSB Version:    :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64                         :graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:prin                         ting-4.0-noarch
Distributor ID: EnterpriseEnterpriseServer
Description:    Enterprise Linux Enterprise Linux Server release 5.9 (Carthage)
Release:        5.9
Codename:       Carthage

As per the output of cat /proc/version, I can see that I am using RedHat 4.1.2. While as per the output of lsb_release -a, I am using Linux Server release 5.9. Which one Is correct?

If yes, how old is it? Because, I am not getting MySQL 5.6 installer for this version. MySQL 5.6 is available only by Red Hat Enterprise Linux 5 / Oracle Linux 5 (x86, 64-bit), RPM Package version of RedHat.

  • Where can I get MySQL 5.6 version for RedHat 4?
  • If not, How can I know which Linux ( Fedora / Ubuntu / Red Hat etc. ) and which version I am using?
Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
ursitesion
  • 1,007

8 Answers8

27

To see the distribution/version you are using, you can try:

lsb_release -a
Graeme
  • 34,027
  • I updated my question. Can you please suggest... – ursitesion Apr 14 '14 at 12:23
  • 18
    lsb_release: not found – ursitesion Apr 02 '15 at 07:14
  • 2
    lsb_release not found. Is there not something more default on any linux system to get at this question? – chrismarx Aug 16 '15 at 20:53
  • @chrismarx, not really. Bear in mind that the lsb part stands for Linux Standard Base, which is an attempt to standardise this kind of thing across all Linux systems. Without it you will just have to try different things until something works. – Graeme Aug 17 '15 at 07:38
  • to bad it's not there by default on centos, that was the system i was trying to find this information for- – chrismarx Aug 17 '15 at 13:27
  • @chrismarx, try /etc/issue as per periket2000's answer. It appears to work on Red Hat based distros. – Graeme Aug 17 '15 at 13:40
  • Interestingly on centos6, that works, but on CentOS Linux release 7.0.1406 (Core), I get "\S Kernel \r on an \m " which is not very helpful. cat redhat-release works fine, once you realize you're on a redhat variant – chrismarx Aug 17 '15 at 13:48
  • As noted in several answers to https://unix.stackexchange.com/q/6345/5132 , as a general answer this is wrong, because the mechanism does not exist in several Linux-based operating systems nowadays. Specifically to the old version of Oracle Linux in the question it may be applicable. – JdeBP Mar 10 '20 at 14:33
24

If you refer to the "comercial" or "human name" (not the kernel) you can do:

cat /etc/issue

this give you

Linux Fedora 13 (Leonidas)

periket2000
  • 2,368
  • The comments at https://unix.stackexchange.com/a/174881/5132 and at a deleted 2011 answer under that same question apply. – JdeBP Mar 10 '20 at 14:25
11

The content /proc/version only gives you information about the kernel. It does not directly provide information about the distribution.

Linux version 2.6.18-348.1.1.0.1.el5

This is the version of the kernel. 2.6.18 is the upstream version number. What follows is a distribution-specific built number. The el5 suffix at the end is a clue that this is a kernel from Red Hat Enterprise Linux version 5.x or a derived version.

(mockbuild@ca-build56.us.oracle.com)

This indicates where the kernel was compiled. Since it was compiled at Oracle, this is the Oracle Linux derivative of RHEL.

(gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP Tue Jan 22 16:39:05 PST 2013

This is the version of the compiler used to compile the kernel. You do not have “Red Hat 4.1.2”, you have (or rather, the machine where the kernel was compiled has) version 4.1.2 of GCC, build number 54 from Red Hat.

The output from lsb_release gives you information about the distribution.

Distributor ID: EnterpriseEnterpriseServer

This is a pretty unhelpful name; it really indicates Oracle Enterprise Linux (now called Oracle Linux).

Release: 5.9

This is version 5.9 of this distribution.


The current major version of RHEL is 6, but version 5 is still supported by Red Hat (the plan is to support it until 2020). You're getting support from Oracle (if at all, depending on what you purchased), not from Red Hat; I don't know what their policy is. Version 5.10 is now out.

Since you've found MySQL 5.6 for RHEL 5, go ahead and install it.

  • My /proc/version had the operating system version as well: Linux version 4.2.0-43 (root@ews-buildserver1204-01) (gcc version 5.4.0 20160603 (Ubuntu 5.4.0-3ubuntu1~12.04) ) #31337 SMP – dfrankow Feb 22 '17 at 18:29
  • @dfrankow That's not the OS you're running, it applies to the compiler (gcc). And it isn't even the OS on which the kernel was compiled, but the OS which the compiler was built for. – Gilles 'SO- stop being evil' Feb 22 '17 at 20:05
5

This looks like Oracle Linux, version 5. Check the file /etc/redhat-release This is an enterprise Linux distribution, largely compatible/comparable with Red Hat Enterprise Linux 5 or CentOS 5.

The idea of the enterprise Linux distro's is to have a long life cycle, 5-10 years, more compatible with enterprise requirements such as stability then bleeding edge, frequently updated distro's like Fedora or Ubuntu.

The consequence is that the bundled and supported software will be quite old. I'm unfamiliar with Oracle Linux, but they may have supported software channels with newer versions then those offered by default. I know Red Hat does. Those may or may not be included in your support contract.

In addition to there are the unsupported Extra Packages for Enteprise Linux (EPEL) which should also work with Oracle Linux, according to blogs.oracle.com.

The unsupported RPM packages offered by MySQL on dev.mysql.com should work as well if you don't want/need to get supported MySQL packages.

HBruijn
  • 7,418
3

Since in many Linux Distributions there are the info files placed in /etc/ folder named *-release (redhat-release, etc), which contains distribution info and sometimes the version just select on the first of them and display it as follows:

$ cat $(ls /etc/*-release |sed 1\!d)
ALT Linux starter kit (Trientalis)

For your case I believe the correct distribution version is placed into the *-release file in /etc, since /proc/version just reflects linux kernel release and build host (I think).

Also there is a facter ruby gem, which gives you some facts about os OS, it analyzes OS release files, other data and prints to terminal screen. You can try is as follows

# apt-get install rubygems

Please use the case above that is eligible for your OS. Then install the gem itself.

# gem install facter

Then use:

$ facter
3
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)

cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.3 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.3"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.3 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.3:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.3
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.3"
look
  • 131
2

You can also use the uname command:

$ uname -a
Linux nodeName 4.2.0-0.bpo.1-amd64 #1 SMP Debian 4.2.6-3~bpo8+2 (2015-12-14) x86_64 GNU/Linux
dr_
  • 29,602
Isidorito
  • 21
  • 1
1

According to your ouput of cat /proc/version, you are using Redhat 4, the newest version is Redhat 7.

AFAIK, you can not run MySQL 5.6 in Redhat 4, it's not supported by MySQL. You can refer to this for more details.

Update

It's my mistake. You are running Oracle Linux 5.9, according to lsb_release ouput.

Oracle Linux 5.9 is fully compatible — both source and binary — with Red Hat Enterprise Linux. So you can go to this site to download MySQL 5.6 and compile it to run on your server. (Or refer to this link to get it from mysql yum repository)

cuonglm
  • 153,898