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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-21-2017, 08:49 AM
|
#1
|
Member
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34
Rep:
|
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.
|
|
|
08-21-2017, 09:26 AM
|
#2
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,895
|
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.
|
|
|
08-21-2017, 09:34 AM
|
#3
|
Member
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34
Original Poster
Rep:
|
Quote:
Originally Posted by hazel
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
|
|
|
08-21-2017, 10:11 AM
|
#4
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,895
|
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.
|
|
|
08-21-2017, 10:37 AM
|
#5
|
Member
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34
Original Poster
Rep:
|
Quote:
Originally Posted by hazel
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
|
|
|
08-21-2017, 10:55 AM
|
#6
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,895
|
Quote:
Originally Posted by haseem saeed
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?
|
|
|
08-21-2017, 11:07 AM
|
#7
|
Member
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34
Original Poster
Rep:
|
Quote:
Originally Posted by hazel
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.
|
|
|
08-21-2017, 11:15 AM
|
#8
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,895
|
Good! Please mark it as solved using the thread tools. You can also mark the posts you found useful.
|
|
|
All times are GMT -5. The time now is 05:49 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|