jaendress3995
Posts: 8
Joined: Mon Apr 18, 2016 12:11 pm

Sudo Error

Fri May 11, 2018 2:25 am

HI
When ever i try to do something as sudo i get the follow error.
when trying to add a shared folder in samba

Code: Select all

pi@TankPi:/ $ sudo nano /etc/samba/smb.conf
sudo: error while loading shared libraries: libsudo_util.so.0: cannot open shared object file: No such file or directory
or even

Code: Select all

pi@TankPi:/ $ sudo su
sudo: error while loading shared libraries: libsudo_util.so.0: cannot open shared object file: No such file or directory
even trying to update

Code: Select all

pi@TankPi:/ $ sudo apt-get update
sudo: error while loading shared libraries: libsudo_util.so.0: cannot open shared object file: No such file or directory
I can run nano as a normal user but not as su

Can anyone help me to fix this please?
Thanks in advance

User avatar
lmarmisa
Posts: 1268
Joined: Thu Feb 14, 2013 2:22 am
Location: Jávea, Spain

Re: Sudo Error

Fri May 11, 2018 9:10 am

Maybe some files stored in your SD are corrupted or lost.

Try the command ls -l /usr/lib/sudo :

Code: Select all

pi@rpi3:~ $ ls -l /usr/lib/sudo
total 464
-rw-r--r-- 1 root root    915 Jun  5  2017 group_file.la
-rw-r--r-- 1 root root   9536 Jun  5  2017 group_file.so
-rw-r--r-- 1 root root    936 Jun  5  2017 libsudo_util.la
lrwxrwxrwx 1 root root     21 Jun  5  2017 libsudo_util.so -> libsudo_util.so.0.0.0
lrwxrwxrwx 1 root root     21 Jun  5  2017 libsudo_util.so.0 -> libsudo_util.so.0.0.0
-rw-r--r-- 1 root root  79500 Jun  5  2017 libsudo_util.so.0.0.0
-rwxr-xr-x 1 root root  13772 Jun  5  2017 sesh
-rw-r--r-- 1 root root    920 Jun  5  2017 sudo_noexec.la
-rw-r--r-- 1 root root   5420 Jun  5  2017 sudo_noexec.so
-rw-r--r-- 1 root root    897 Jun  5  2017 sudoers.la
-rw-r--r-- 1 root root 325664 Jun  5  2017 sudoers.so
-rw-r--r-- 1 root root    927 Jun  5  2017 system_group.la
-rw-r--r-- 1 root root   5436 Jun  5  2017 system_group.so
pi@rpi3:~ $ 
The symlink libsudo_util.so.0 is correct in my case and probably wrong in yours:

Code: Select all

lrwxrwxrwx 1 root root     21 Jun  5  2017 libsudo_util.so.0 -> libsudo_util.so.0.0.0
Not easy to fix the problem. You would need to become root but sudo is out of order. You will need another Linux system (pc, virtual machine, RPi) for repairing your sd card. But how many files are lost or corrupted?.

jaendress3995
Posts: 8
Joined: Mon Apr 18, 2016 12:11 pm

Re: Sudo Error

Fri May 11, 2018 11:44 am

mine looks the same as yours lmarmisa

Code: Select all

pi@TankPi:~ $ ls -l /usr/lib/sudo
total 464
-rw-r--r-- 1 root root    915 Jun  5  2017 group_file.la
-rw-r--r-- 1 root root   9536 Jun  5  2017 group_file.so
-rw-r--r-- 1 root root    936 Jun  5  2017 libsudo_util.la
lrwxrwxrwx 1 root root     21 Jun  5  2017 libsudo_util.so -> libsudo_util.so.0.0.0
lrwxrwxrwx 1 root root     21 Jun  5  2017 libsudo_util.so.0 -> libsudo_util.so.0.0.0
-rw-r--r-- 1 root root  79500 Jun  5  2017 libsudo_util.so.0.0.0
-rwxr-xr-x 1 root root  13772 Jun  5  2017 sesh
-rw-r--r-- 1 root root    897 Jun  5  2017 sudoers.la
-rw-r--r-- 1 root root 325664 Jun  5  2017 sudoers.so
-rw-r--r-- 1 root root    920 Jun  5  2017 sudo_noexec.la
-rw-r--r-- 1 root root   5420 Jun  5  2017 sudo_noexec.so
-rw-r--r-- 1 root root    927 Jun  5  2017 system_group.la
-rw-r--r-- 1 root root   5436 Jun  5  2017 system_group.so

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Sudo Error

Fri May 11, 2018 12:01 pm

If the content of that directory looks correct, maybe it is the library search path that has become corrupted? So the system never looks in that directory to find the symlink and the target.

(But I have no insight into how to diagnose or fix this without superuser access rights... )

Can you backtrack through your shell history etc to work out how/where this got broken?

User avatar
lmarmisa
Posts: 1268
Joined: Thu Feb 14, 2013 2:22 am
Location: Jávea, Spain

Re: Sudo Error

Fri May 11, 2018 12:27 pm

Try this command:

Code: Select all

/usr/bin/sudo /sbin/ldconfig -v

jaendress3995
Posts: 8
Joined: Mon Apr 18, 2016 12:11 pm

Re: Sudo Error

Tue May 15, 2018 8:55 am

still no luck

Code: Select all

pi@TankPi:~ $ /usr/bin/sudo /sbin/ldconfig -v
/usr/bin/sudo: error while loading shared libraries: libsudo_util.so.0: cannot open shared object file: No such file or directory
I have had a look in '/usr/bin/sudo' folder and found that there is not a sudo folder.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Sudo Error

Tue May 15, 2018 9:07 am

I have had a look in '/usr/bin/sudo' folder and found that there is not a sudo folder.



Why would there be? /usr/bin/sudo is simply an executable program.

These are some comparative details from my RPi3B+/Raspbian Stretch system -

Code: Select all

pi@RPi3BplusOffice:~ $ which sudo
/usr/bin/sudo
pi@RPi3BplusOffice:~ $ ls -al /usr/bin/sudo
-rwsr-xr-x 1 root root 135376 Jun  5  2017 /usr/bin/sudo
pi@RPi3BplusOffice:~ $
pi@RPi3BplusOffice:~ $ file /usr/bin/sudo
/usr/bin/sudo: setuid ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=02ae0f4b730edb6e01fb34a818cd7ee4a58fc033, stripped
pi@RPi3BplusOffice:~ $ ls -al /usr/bin/su*
-rwsr-xr-x 1 root root 135376 Jun  5  2017 /usr/bin/sudo
lrwxrwxrwx 1 root root      4 Jun  5  2017 /usr/bin/sudoedit -> sudo
-rwxr-xr-x 1 root root  42776 Jun  5  2017 /usr/bin/sudoreplay
-rwxr-xr-x 1 root root  34648 Feb 22  2017 /usr/bin/sum
pi@RPi3BplusOffice:~ $ ls -al /usr/bin/sudo/*
ls: cannot access '/usr/bin/sudo/*': Not a directory
pi@RPi3BplusOffice:~ $


jaendress3995
Posts: 8
Joined: Mon Apr 18, 2016 12:11 pm

Re: Sudo Error

Tue May 15, 2018 9:46 am

ls doesn't even show sudo at all.
Screen shot of my /bin folder https://drive.google.com/open?id=19yzRb ... jSLUT04Nvh

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Sudo Error

Tue May 15, 2018 9:52 am

jaendress3995 wrote:
Tue May 15, 2018 9:46 am
ls doesn't even show sudo at all.
Screen shot of my /bin folder https://drive.google.com/open?id=19yzRb ... jSLUT04Nvh
Please have another look at @BGoode's post...
You're looking in /bin
'sudo' is in /usr/bin

User avatar
lmarmisa
Posts: 1268
Joined: Thu Feb 14, 2013 2:22 am
Location: Jávea, Spain

Re: Sudo Error

Tue May 15, 2018 9:52 am

Your made a mistake. The folder should be /usr/bin:

Code: Select all

pi@rpi:~ $ ls -l /usr/bin/sudo
-rwsr-xr-x 1 root root 135376 Jun  5  2017 /usr/bin/sudo
pi@rpi:~ $

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Sudo Error

Tue May 15, 2018 9:55 am

Please post the output from

Code: Select all

which sudo

jaendress3995
Posts: 8
Joined: Mon Apr 18, 2016 12:11 pm

Re: Sudo Error

Tue May 15, 2018 10:07 am

oops, I have now looked in the right /bin folder /usr/bin sudo is there. sudo just wont work

Code: Select all

pi@TankPi:~ $ which sudo
/usr/bin/sudo

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Sudo Error

Tue May 15, 2018 10:31 am

jaendress3995 wrote:
Tue May 15, 2018 10:07 am
oops, I have now looked in the right /bin folder /usr/bin sudo is there. sudo just wont work

Code: Select all

pi@TankPi:~ $ which sudo
/usr/bin/sudo
We seem to have gotten off on a wild goose chase. The existence of the sudo executable was never in doubt; the problem has to do with one of the shared libraries that it uses/needs.

The original error message was:
pi@TankPi:/ $ sudo nano /etc/samba/smb.conf
sudo: error while loading shared libraries: libsudo_util.so.0: cannot open shared object file: No such file or directory
Therefore, the key is to figure out if that shared library file is missing or damaged. Doing a little investigation on a Jessie system, I find no reference to "libsudo":

Code: Select all

 $ ldd /usr/bin/sudo
        linux-vdso.so.1 (0x7ef94000)
        /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76f94000)
        libaudit.so.1 => /lib/arm-linux-gnueabihf/libaudit.so.1 (0x76f4b000)
        libselinux.so.1 => /lib/arm-linux-gnueabihf/libselinux.so.1 (0x76f1e000)
        libutil.so.1 => /lib/arm-linux-gnueabihf/libutil.so.1 (0x76f0b000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76ef8000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76db7000)
        /lib/ld-linux-armhf.so.3 (0x54b78000)
        libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0x76d43000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76d1b000)
$
But on Stretch:

Code: Select all

$ ldd /usr/bin/sudo
	/usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6f45000)
	libaudit.so.1 => /lib/arm-linux-gnueabihf/libaudit.so.1 (0xb6ef9000)
	libselinux.so.1 => /lib/arm-linux-gnueabihf/libselinux.so.1 (0xb6ec6000)
	libutil.so.1 => /lib/arm-linux-gnueabihf/libutil.so.1 (0xb6eb3000)
	libsudo_util.so.0 => /usr/lib/sudo/libsudo_util.so.0 (0xb6e8f000)
	libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6e7c000)
	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6d3d000)
	/lib/ld-linux-armhf.so.3 (0xb6f8d000)
	libcap-ng.so.0 => /lib/arm-linux-gnueabihf/libcap-ng.so.0 (0xb6d28000)
	libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb6caf000)
	libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6c86000)
$ locate libsudo
/usr/lib/sudo/libsudo_util.la
/usr/lib/sudo/libsudo_util.so
/usr/lib/sudo/libsudo_util.so.0
/usr/lib/sudo/libsudo_util.so.0.0.0
$
So, my guess is that OP is running the Stretch version of sudo on a Jessie system.

Or something along those lines...

In any case, the next steps for OP are:

1) Figure out if his version of "sudo" uses libsudo. ldd will tell this.
2) Figure out if his system has libsudo. ls will tell this.
3) Figure out if his libsudo is corrupt. Comparison (via cmp) with an original copy from the Raspbian Stretch image will tell this.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
lmarmisa
Posts: 1268
Joined: Thu Feb 14, 2013 2:22 am
Location: Jávea, Spain

Re: Sudo Error

Tue May 15, 2018 10:57 am

Did you install manually some external package not included in repositories?.

Something in shared libraries seems corrupted. But possibly not strictly related to sudo.

These are the fingerprints related to sudo and its shared library libsudo_util.so.0.0.0. Probably you will get the same fingerprints in your case:

Code: Select all

pi@rpi:~ $ md5sum /usr/lib/sudo/libsudo_util.so.0.0.0 /usr/bin/sudo
e5ec4f839e6772cfe8dbe99feba7fd1e  /usr/lib/sudo/libsudo_util.so.0.0.0
e6a11c46bed327e58f21afbe5b0cdb1e  /usr/bin/sudo
pi@rpi:~ $
This solution probably would work but you need root privileges :x and sudo is broken:

https://itsfoss.com/error-while-loading ... libraries/

A lot of effort would be required for fixing your problem and no success is guaranteed.

What about a fresh new install with strech?. Of couse, you can use a different SD if you wish to preserve your files.

Return to “Troubleshooting”