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 ([email protected]) (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
68.8k35 gold badges122 silver badges263 bronze badges
asked Apr 14, 2014 at 10:41
1
  • Seems like we have several questions in here. Commented Apr 1, 2015 at 21:23

8 Answers 8

27

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

lsb_release -a
answered Apr 14, 2014 at 10:55
8
  • I updated my question. Can you please suggest... Commented Apr 14, 2014 at 12:23
  • 18
    lsb_release: not found Commented Apr 2, 2015 at 7:14
  • 2
    lsb_release not found. Is there not something more default on any linux system to get at this question? Commented Aug 16, 2015 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. Commented Aug 17, 2015 at 7:38
  • to bad it's not there by default on centos, that was the system i was trying to find this information for- Commented Aug 17, 2015 at 13:27
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)

answered Apr 15, 2014 at 6:41
1
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.

([email protected])

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.

answered Apr 15, 2014 at 1:02
2
  • 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 Commented Feb 22, 2017 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. Commented Feb 22, 2017 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.

answered Apr 14, 2014 at 13:11
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"
answered Dec 7, 2016 at 23:30
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
answered Aug 7, 2016 at 13:43
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_
32.3k22 gold badges102 silver badges146 bronze badges
answered Dec 1, 2016 at 14:12
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)

answered Apr 14, 2014 at 10:48
3
  • I updated my question. Please help... Commented Apr 14, 2014 at 12:23
  • Why these two command provide two different results? On which, should I believe? Commented Apr 15, 2014 at 6:59
  • /proc/version show the version of gcc compiler, you can run gcc -v to check. Commented Apr 15, 2014 at 9:24

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.