You need to manually specify the dynamic loader and library path:
LD_LIBRARY_PATH=/usr/lib64_bck /usr/lib64_bck/ld-linux-x86-64.so.2 /usr/bin/mv /usr/lib64_bck /usr/lib64
The way this works is as follows. mv
can no longer run on its own, because its interpreter, /lib64/ld-linux-x86-64.so.2
, has disappeared (on RHEL 7, /lib64
is a symlink to /usr/lib64
); so instead of running mv
directly, we run the interpreter, asking it to load mv
:
/usr/lib64_bck/ld-linux-x86-64.so.2 /usr/bin/mv /usr/lib64_bck /usr/lib64
This will still fail because the dynamic linker can’t find the required libraries, so we specify the updated path, resulting in the command given at the top.
See also What is /lib64/ld-linux-x86-64.so.2 and why can it be used to execute file?