LinuxQuestions.org
Visit Jeremy's Blog.
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 08-21-2017, 08:49 AM   #1
haseem saeed
Member
 
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34

Rep: Reputation: Disabled
Unhappy bash: /bin/ls: /lib/ld-linux.so.2


Dear ALL,

i made a script to move data from one place to another i got error while running the script so i stopped the script. after this whenever i am running a command i am getting the error

bash: /bin/ls: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

when trying to install glibc.i686
i am getting the following error
bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

i hope that someone can help me out in resolving this issue.
 
Old 08-21-2017, 09:26 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,895
Blog Entries: 19

Rep: Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572
The first error suggests that you are trying to run 32-bit programs on a 64-bit system. In theory, installing glibc.i686 would solve that problem. But it would surely be better to find out how you got into this mess in the first place.

You can run file on the commands that are failing in order to check their internal format. Also check where your python program is by using which python. Yum expects it to be in /usr/bin but maybe you have it installed somewhere else.
 
Old 08-21-2017, 09:34 AM   #3
haseem saeed
Member
 
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34

Original Poster
Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by hazel View Post
The first error suggests that you are trying to run 32-bit programs on a 64-bit system. In theory, installing glibc.i686 would solve that problem. But it would surely be better to find out how you got into this mess in the first place.

You can run file on the commands that are failing in order to check their internal format. Also check where your python program is by using which python. Yum expects it to be in /usr/bin but maybe you have it installed somewhere else.
Thanks for your input
I have tried to use the file command and it is giving me the following error.

file
bash: file: command not found

which python
bash: /usr/bin/which: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
 
Old 08-21-2017, 10:11 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,895
Blog Entries: 19

Rep: Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572
Wow, you've really messed up your system! file and which ought to be in the same directory: /usr/bin. Yet you can find which (it doesn't run but at least it's there) while file apparently isn't.

Tell us what distro you are using (obviously it's something in the Red Hat family as it uses yum). And what exactly were you doing when it all went pear-shaped? "I was running a script" isn't good enough. What was the script doing when it crashed? What kind of data were you trying to move around? Because it looks to me as if, at the very least, you have moved some program files out of place.

I think you now need to boot from a rescue disc (you should be able to use your installation disc for that) and find out exactly where these programs have got to and what format they have. On paper make a list of the commands that aren't found and another of the ones that give an ELF error and check them all from your rescue disk. Also check the identity of the ld-linux dynamic link loader in /lib. For a 64-bit system it should be called ld-linux-x86-64.so.2. For a 32-bit system it's ld-linux.so.2.
 
Old 08-21-2017, 10:37 AM   #5
haseem saeed
Member
 
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34

Original Poster
Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by hazel View Post
Wow, you've really messed up your system! file and which ought to be in the same directory: /usr/bin. Yet you can find which (it doesn't run but at least it's there) while file apparently isn't.

Tell us what distro you are using (obviously it's something in the Red Hat family as it uses yum). And what exactly were you doing when it all went pear-shaped? "I was running a script" isn't good enough. What was the script doing when it crashed? What kind of data were you trying to move around? Because it looks to me as if, at the very least, you have moved some program files out of place.

I think you now need to boot from a rescue disc (you should be able to use your installation disc for that) and find out exactly where these programs have got to and what format they have. On paper make a list of the commands that aren't found and another of the ones that give an ELF error and check them all from your rescue disk. Also check the identity of the ld-linux dynamic link loader in /lib. For a 64-bit system it should be called ld-linux-x86-64.so.2. For a 32-bit system it's ld-linux.so.2.
Yes i can see that i have moved my library files into /mnt/ before sometime i was able to use busybox but after changing the $PATH i am not able to use it can you please guide me the way to use it again the $PATH which was set before was like below
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/c4s-admin/bin:/bin:/usr/local/bin:/root/bin
CAn you please help me in this setting this as echo command is working
 
Old 08-21-2017, 10:55 AM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,895
Blog Entries: 19

Rep: Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572
Quote:
Originally Posted by haseem saeed View Post
Yes i can see that i have moved my library files into /mnt/ before sometime i was able to use busybox but after changing the $PATH i am not able to use it can you please guide me the way to use it again the $PATH which was set before was like below
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/c4s-admin/bin:/bin:/usr/local/bin:/root/bin
CAn you please help me in this setting this as echo command is working
Just type PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/c4s-admin/bin:/bin:/usr/local/bin:/root/bin.

For the future, make sure you have the path written down correctly in your $HOME/.bash_profile file, so that it will be set correctly whenever you log in. And put your library files back where they belong! What on earth are they doing in /mnt?
 
Old 08-21-2017, 11:07 AM   #7
haseem saeed
Member
 
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34

Original Poster
Rep: Reputation: Disabled
Wink

Quote:
Originally Posted by hazel View Post
Just type PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/c4s-admin/bin:/bin:/usr/local/bin:/root/bin.

For the future, make sure you have the path written down correctly in your $HOME/.bash_profile file, so that it will be set correctly whenever you log in. And put your library files back where they belong! What on earth are they doing in /mnt?
yeah i just solved it thanks to busybox and you.
 
Old 08-21-2017, 11:15 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,895
Blog Entries: 19

Rep: Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572Reputation: 4572
Good! Please mark it as solved using the thread tools. You can also mark the posts you found useful.
 
  


Reply

Tags
centos, lib, path


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
Combine two or more bin files into another bin file at specific addresses in bash WSRaptor Programming 1 04-20-2015 02:36 PM
"bash: /usr/bin/: /lib/ld-linux.so.2: bad ELF interpreter: No such file or direc LittleMaster Linux - Server 4 05-25-2013 03:42 AM
[SOLVED] /usr/bin/xterm: Could not exec /bin/bash: Permission Denied suheng Linux - Newbie 2 09-24-2010 05:31 PM
Can MySQL log on via SSH/bash? mysql:x:27:101:MySQL Server:/var/lib/mysql:/bin/bash Ujjain Linux - Newbie 2 04-24-2009 02:21 PM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 06:42 PM

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

All times are GMT -5. The time now is 05:49 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
Open Source Consulting | Domain Registration