I accidentally renamed the directory /usr into /usr_bak.
I want to change it back, so I append the path /usr_bak/bin to $PATH to allow the system to find the command sudo.
But now sudo mv /usr_bak /usr gives me the error:
sudo: error while loading shared libraries: libsudo_util.so.0: cannot open shared object file: No such file or directory
Is there a way to rename the /usr_bak as /usr besides reinstalling the system?
sudoeven got to library stage, it's usually in/usr/bin/and should have failed with a command-not-found error. Also, do you have a root password set? – muru Mar 19 '18 at 03:24not foundbefore so I appended the new path/usr_bak/binto$PATHand now I get the error in my post here... – Yves Mar 19 '18 at 03:27ldd /usr/bin/sudoonly shows shared libraries outside of/usr. – David Foerster Mar 19 '18 at 14:47/usr(libsudo_util.so.0 => /usr/lib/sudo/libsudo_util.so.0 (0x00007faf9855d000)) – muru Mar 19 '18 at 15:04/usrof Ubuntu 16.04 to overwrite the/usrof Ubuntu 17.10... – Yves Mar 19 '18 at 17:55qemu -nographicorpref.vmplayer.exit.vmAction = "disconnect"– phuclv Mar 21 '18 at 03:00schroot) an alternate distro version inside a chroot. IIRC, there's maybe some integration with package build scripts. – Peter Cordes Mar 21 '18 at 10:35sudo -sto get a root shell before temporarily breaking your system, I think you could have run/bin/mv, or even usedLD_LIBRARY_PATH=/usr_bak/libto run/usr_bak/bin/whatever foo bar. ButLD_LIBRARY_PATHdoesn't apply to setuid executables, so that only worksif you have a root shell already or can log in to one on a text console or whatever.) – Peter Cordes Mar 21 '18 at 10:40