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?
sudo
even 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 found
before so I appended the new path/usr_bak/bin
to$PATH
and now I get the error in my post here... – Yves Mar 19 '18 at 03:27ldd /usr/bin/sudo
only 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/usr
of Ubuntu 16.04 to overwrite the/usr
of Ubuntu 17.10... – Yves Mar 19 '18 at 17:55qemu -nographic
orpref.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 -s
to get a root shell before temporarily breaking your system, I think you could have run/bin/mv
, or even usedLD_LIBRARY_PATH=/usr_bak/lib
to run/usr_bak/bin/whatever foo bar
. ButLD_LIBRARY_PATH
doesn'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