cannot execute binary file
Hi,
I am getting the error message "-bash: /bin/hostname: cannot execute binary file" while login to my server through SSH. Can anyone please help me to resolve this problem? I searched on the web, but not found useful solution. Also, i could not use the command like, 1. cat /var/log/messages --- its working 2. cat /var/log/messages --- it gives the error message bash: /bin/more: cannot execute binary file Thanks. Tamilselvan. |
Hi,
I am getting the error message "-bash: /bin/hostname: cannot execute binary file" while login to my server through SSH. Can anyone please help me to resolve this problem? I searched on the web, but not found useful solution. Also, i could not use the command like, 1. cat /var/log/messages --- its working 2. cat /var/log/messages --- it gives the error message bash: /bin/more: cannot execute binary file |
Hello tamilselvan.forum,
Quote:
Please explain in detail what you have done till now to get this message... |
Tell us which distro and version you've got.
|
that does not make sense
|
It sounds to me like he's lost the +x perms on various binaries; I'd like to see
ls -l more ls -l hostname As I asked above, it's going to be easier to suggest a fix if we know what distro he's got. eg for Redhat systems (assuming std binaries installed via yum) http://www.cyberciti.biz/tips/reset-...ermission.html |
Sorry, I missed the "more" in my second point. When i run the command cat /var/log/messages|more - it gives the error message as bash: /bin/more: cannot execute binary file.
I am using the RedHat Linux Enterprise Server. The "uname -a" is showing the output: Linux (none) 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:15 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux Also, how can we know which binary is installed in the server? Thanks Tamilselvan. |
I tried to list out the installed rpm packages, it shows the error message
rpm -qa bash: /bin/rpm: cannot execute binary file What would be the problem? Thanks for helping me. |
Quote:
Somehow, your system contains binaries that are not intended for the computer (or the OS) they are installed on. |
Can we have
cat /etc/redhat-release ls -l more ls -l hostname file more file hostname and have you tried that reset link I gave you? What were the results/msgs? |
Quote:
Which distribution was that? |
Quote:
#rpm --setperms /bin/more The result was bash: /bin/rpm: cannot execute binary file I am connecting to our server thru SSH and working on it. The result for cat /etc/redhat-release is Red Hat Enterprise Linux Server release 5.2 (Tikanga) ls -l more is -rwxr-xr-x 1 root root 44072 Jan 11 2009 more ls -l hostname is -rwxr-xr-x 1 root root 24200 Jan 11 2009 hostname file more is more: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), corrupted program header size, corrupted section header size file hostname is hostname: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), corrupted program header size, corrupted section header size But the command file cat is cat: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped It seems some of the bin directory files are corrupted. What can we do for this? Thanks chrism01, we are in the right way to solve the problem |
Ok, you need to use this page to figure out which pkgs need a re-install http://kbase.redhat.com/faq/docs/DOC-2531 and then do a '--force' re-install.
I suspect it's prob coreutils or somesuch. Actually, if 'file rpm' shows corruption, it could get tricky. Try the above advice anyway. If it fails, I think you may be looking at backing up any user data/cfgs & re-install Os. Alternately, if you have another system with same version of RHEL (or you can install a pc temporarily), you could just replace the corrupted binaries by copyng over from a clean install. Basically, cd into the relevant dir(s) and run file * |grep corrupt >corrupted_files.lst to get the list(s). |
All times are GMT -5. The time now is 12:05 PM. |