LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-16-2015, 05:24 AM   #1
prakash_kumar
LQ Newbie
 
Registered: Jan 2015
Posts: 24

Rep: Reputation: Disabled
grep is not working in RHEL5.3


Hi,

I have Redhat 5.3 running on my machine. But when I am login through putty it gives me below error.
Without running any grep command I get this error on login and the grep command doesn't work.

login as: root
root@IP's password:
Last login: Mon Feb 16 15:27:55 2015 from IP
-bash: /bin/egrep: cannot execute binary file
-bash: /bin/egrep: cannot execute binary file
-bash: /bin/egrep: cannot execute binary file
-bash: /bin/grep: cannot execute binary file
-bash: /bin/grep: cannot execute binary file
[root@bkpdrill ~]# grep MemTotal /proc/meminfo
-bash: /bin/grep: cannot execute binary file
 
Old 02-16-2015, 05:30 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,442

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
what will uname -a and file /bin/grep respond ?
 
Old 02-16-2015, 06:05 AM   #3
prakash_kumar
LQ Newbie
 
Registered: Jan 2015
Posts: 24

Original Poster
Rep: Reputation: Disabled
Please find below output:-

[root@bkpdrill ~]# uname -a
Linux bkpdrill.icat.com 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@bkpdrill ~]# file /bin/grep
/bin/grep: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), corrupted program header size, corrupted section header size
[root@bkpdrill ~]#
 
Old 02-16-2015, 06:07 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,442

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
So as you can see grep itself is corrupted. Probably you can try to reinstall, but would be nice to know the reason.
 
Old 02-16-2015, 06:28 AM   #5
prakash_kumar
LQ Newbie
 
Registered: Jan 2015
Posts: 24

Original Poster
Rep: Reputation: Disabled
Should I have to uninstall it before reinstall? Can you tell me which version I have to install?
 
Old 02-16-2015, 06:32 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,442

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
No you do not need to uninstall I think and also you need to install the package belongs that release (RHEL 5.3)
 
Old 02-16-2015, 06:35 AM   #7
prakash_kumar
LQ Newbie
 
Registered: Jan 2015
Posts: 24

Original Poster
Rep: Reputation: Disabled
Hi
I download grep package but while installing it gives me below error.

[root@bkpdrill icat]# rpm -ivh grep-2.6.3-6.el6.x86_64.rpm
rpm: error while loading shared libraries: librpm-4.4.so: wrong ELF class: ELFCLASS64
[root@bkpdrill icat]#

Please help me on this?
 
Old 02-16-2015, 06:36 AM   #8
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,442

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
I would say there are other corrupted files or ??? Something strange happened. Probably you need to reinstall everything.
 
Old 02-16-2015, 06:38 AM   #9
prakash_kumar
LQ Newbie
 
Registered: Jan 2015
Posts: 24

Original Poster
Rep: Reputation: Disabled
Can you Please tell me which all things need to be reinstalled?
 
Old 02-16-2015, 06:40 AM   #10
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,442

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
sorry, I have no idea what's happened, probably you need to reinstall the whole OS again (not only a few packages). But save your important data before that.
 
Old 02-16-2015, 06:44 AM   #11
prakash_kumar
LQ Newbie
 
Registered: Jan 2015
Posts: 24

Original Poster
Rep: Reputation: Disabled
I cannot reinstall the whole OS. Can any one help me how to reinstall grep?
Also the below error is coming when I fire the command rpm -help
error while loading shared libraries: librpm-4.4.so: wrong ELF class: ELFCLASS64

Last edited by prakash_kumar; 02-16-2015 at 06:47 AM.
 
Old 02-16-2015, 10:24 AM   #12
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,991

Rep: Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317
Quote:
Originally Posted by prakash_kumar View Post
I cannot reinstall the whole OS.
Sorry, but that is JUST NOT TRUE. If the OS was installed, that means it can be REinstalled as well.
Quote:
Can any one help me how to reinstall grep?
We tried to, and you were told to get the RHEL 5.3 media and re-install it from there. You ignored that advice, and downloaded a package for RHEL6, and then were amazed that it didn't work on RHEL5. Not much else we can tell you past that.
Quote:
Also the below error is coming when I fire the command rpm -help error while loading shared libraries: librpm-4.4.so: wrong ELF class: ELFCLASS64
Again, you need to re-install your system...you appear to be having several serious issues. Also, again, RHEL5.3 is ANCIENT, and you really should NOT be using it. The latest is RHEL7.x, so download and install it...but only if you're PAYING FOR IT. Otherwise, use CentOS instead. As you were told in your OTHER thread:

http://www.linuxquestions.org/questi...-a-4175531803/

...where you said you ran 'rm -rfv /', then said you didn't have a valid backup of your system.

Last edited by TB0ne; 02-16-2015 at 10:26 AM.
 
Old 02-16-2015, 03:11 PM   #13
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,107

Rep: Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478
Quote:
rpm -ivh grep-2.6.3-6.el6.x86_64.rpm
you DO KNOW that is the rpm for some version of RHEL6
NOT for RHEL5 !!!!

you can NOT mix two very different operating systems together

think of it a trying to install windows 8 exe file on XP
and by doing that with copy/paste

with this being REDHAT
you BOUGHT IT!!! for the SUPPORT you get with the REQUIRED support contract

contact redhat
you are paying a lot of cash every year for that support
You might want to use it
 
Old 02-17-2015, 07:39 AM   #14
prakash_kumar
LQ Newbie
 
Registered: Jan 2015
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thanks for the reply. I copied the grep and rpm files from other machine of the same architecture. This worked perfectly fine with "grep", which was not working earlier
But this is not working for "rpm". I also copied some rpm dependent libraries as mentioned below:
/usr/lib64/librpm.so.1
/usr/lib64/librpmbuild.so.1
/usr/lib64/librpmio.so.1
/lib64/libcap.so.2
/lib64/libdb-4.7.so
/usr/lib64/libdb-4.7.so
/usr/lib64/liblzma.so.0
/usr/lib64/liblzma.so.0.0.0
/usr/lib64/liblua-5.1.so

After this when I fire rpm --help command I get the following error message:

[root@bkpdrill ~]# rpm --help
rpm: /usr/lib64/libpopt.so.0: no version information available (required by rpm)
rpm: /usr/lib64/libpopt.so.0: no version information available (required by /usr/lib64/librpmbuild.so.1)
rpm: /usr/lib64/libpopt.so.0: no version information available (required by /usr/lib64/librpm.so.1)
rpm: /usr/lib64/libpopt.so.0: no version information available (required by /usr/lib64/librpmio.so.1)
rpm: /lib64/libc.so.6: version `GLIBC_2.7' not found (required by /usr/lib64/liblua-5.1.so)
rpm: /lib64/libc.so.6: version `GLIBC_2.11' not found (required by /usr/lib64/liblua-5.1.so)

Can you please tell me what this error is and how can this be resolved?
Thank you in advance !!!
 
Old 02-17-2015, 08:55 AM   #15
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,991

Rep: Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317Reputation: 4317
Quote:
Originally Posted by prakash_kumar View Post
Thanks for the reply. I copied the grep and rpm files from other machine of the same architecture. This worked perfectly fine with "grep", which was not working earlier

But this is not working for "rpm". I also copied some rpm dependent libraries as mentioned below: After this when I fire rpm --help command I get the following error message:

Can you please tell me what this error is and how can this be resolved?
We have ALREADY TOLD YOU, and also have TOLD YOU HOW TO RESOLVE IT, but you seem to be selectively ignoring what you get told.

AGAIN: YOU NEED TO DO A FRESH INSTALLATION. You ran the 'rm -rfv /' command, and didn't restore from backup...congratulations, you have erased MANY Parts of your VERY OLD SYSTEM. You have ONE OPTION LEFT..do a fresh installation of the LATEST RHEL. AGAIN, 5.3 is OLD and UNSUPPORTED...7.x is the most current, and if you don't play on PAYING FOR RHEL, then load CentOS 7.x instead. If you ARE PAYING for RHEL extended support for 5.3, then CALL RED HAT, and ask what they suggest.

To recap, before you ask yet again what you can do to fix your system:
  • Restore from backups (which you said you didn't have, after you ran the rm command)
  • Do a fresh installation of RHEL 5.3 and apply the patches which you're paying for (which you STILL haven't said whether you're paying for RHEL or not)
  • Do a fresh installation of RHEL 7.x, and apply the updates which you are PAYING FOR (or load CentOS 7.x if you don't plan on paying)
Those are your ONLY OPTIONS. Pick one.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPtables rules are not working in RHEL- 6.5 and it was working in RHEL5.9 sekarlinux Linux - Newbie 2 02-14-2015 12:45 PM
Creating an alias in ksh that uses grep and includes 'grep -v grep' doug248 Linux - Newbie 2 08-05-2012 02:07 PM
sound not working in rhel5 gopinath1983 Linux - Newbie 4 11-18-2010 03:28 PM
RHEL5, lspci not working fzanella Linux - Newbie 2 07-22-2009 04:01 PM
yum not working in rhel5 shipon_97 Linux - Newbie 1 05-10-2009 07:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration