2

First I backed up /usr/lib64 folder by copying it including all its content and named it lib64_bk, and then I made some modifications on the original folder, because of that I found myself on the need of restoring the back up folder, however I did it the wrong way.

The first thing I did was to rename the original folder from lib64 to lib64_old by using this command:

mv /usr/lib64 /usr/lib64_old

And I was planning to restore the back up by renaming the other folder from lib64_bk to lib64

After this, whenever I run commands like ls or cp I get a message like this:

bash: /usr/bin/ls: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

Please help me, I certainly realize that I have messed up the OS installation, now I need to know if there's a way to recover it.

Thanks in advance.

2
  • Did you rename the lib64_bk folder back to lib64 yet? If yes, were any other changes made to other folders? Just renaming it looks like it should "roll back" the peoblem change. Do you have a live DVD/USB to use?
    – Xen2050
    May 26, 2018 at 5:03
  • I haven't don't that because I'm not able to. I get the same error message when trying to use mv command to rename it, in a few words the terminal is useless. No I don't have a DVD or USB, but it will be useful to know how to use it. May 26, 2018 at 5:09

2 Answers 2

1

You should be able to bring back the /usr/lib64 directory temporary by running these commands:

cd /usr
/sbin/sln lib64_old lib64

sln is statically linked, so it will not need the /usr/lib64 directory to run.

1
  • it's work, thank you :) Mar 18, 2020 at 15:13
0

If you don't mind rebooting, and have another linux live DVD/USB...

  1. boot into the live linux
  2. mount the partition that has your main OS's /usr folder
  3. rename/copy your backup folder from lib64_bk back to lib64
  4. boot into your main OS

If the only change was renaming that folder, then changing it back should fix things.


Without rebooting, you might have luck with another program that can rename / copy / move folders that doesn't need anything in /usr/lib64, but I'm not sure what might work, maybe a perl script/program?

Or if you can still create a link, it might be possible to link the old lib64-bk so you see it instead of the broken lib64.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .