Forums

stassen
stassen
Offline
Resolved
0 votes
I've made a mistake by deleting 2 ln's in my root directory running into a major issue.

I can't execute most of the commands anymore on my machine because I get almost constant "/lib64/ld-linux-x86-64.so.2: bad ELF interpreter:" errors.

eg:

trying to execute $ln
-bash: /usr/bin/ln: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

Can't even excute ls or yum to correct this.

Have still access via ssh (and directly via a keyboard/monitor).

is there a way that I can add these libraries to my path or is there another solution to resolve this ?
Sunday, December 26 2021, 11:09 AM
Share this post:
Responses (2)
  • Accepted Answer

    stassen
    stassen
    Offline
    Sunday, December 26 2021, 02:53 PM - #Permalink
    Resolved
    0 votes
    @Nick,

    I deleted the symbolic links but was able to recreate these (via a very long way).

    Due to the fact that bash was working anymore I needed an alternative to create this symbolic link. I found the sash executable (https://altlinux.pkgs.org/p10/classic-x86_64/sash-3.4-alt2.qa2.x86_64.rpm.html), which I was able to extract and make it executable.

    Due to the fact that my flexshares were still up and running I was able to get this executable in my platform without shutting down. Meanwhile my only ssh terminal session was still working although I could have done this also via my local terminal access.
    Still had to find out how to deal with the sash commands but in the end I was able to copy sash to my root and use it there to re-create the symbolic links lib->/usr/lib and lib64->/usr/lib64.

    That made my day ! Finally can access everything again.

    Hopefully this method can help someone else that makes the same mistake ;-)
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, December 26 2021, 12:09 PM - #Permalink
    Resolved
    0 votes
    You should not have any packages in your root directory.
    /usr/lib64/ld-linux-x86-64.so.2 comes from the glibc package. It is a symlink to /usr/lib64/ld-2.17.so. Do you have that file? If you do and you can't recreate the symlink with "ln ...", then make a copy of /usr/lib64/ld-2.17.so calling it /usr/lib64/ld-linux-x86-64.so.2. If that gets you up an running, then try a "yum reinstall glibc".
    The reply is currently minimized Show
Your Reply