Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-04-2016, 03:36 AM   #1
LQ Newbie
Registered: Jul 2009
Posts: 28

Rep: Reputation: 0
Difference in output of ldd command with and without sudo

I'm working on following Linux OS.
Ubuntu 14.04.3 LTS \n \l
Linux Debian jessie/sid ( 3.13.0-62-generic x86_64)

I'm seeing difference in output of ldd command with and without sudo for the same executable as below.

$ ldd ./hpcc => (0x00007fff74ba6000) => /home/lml/install_1/lib/ (0x00007f4a5559a000) => /lib/x86_64-linux-gnu/ (0x00007f4a5537c000) => /lib/x86_64-linux-gnu/ (0x00007f4a55076000) => /lib/x86_64-linux-gnu/ (0x00007f4a54cb1000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4a54aa8000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4a5488f000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4a54688000) => /usr/lib/ (0x00007f4a5447b000) => /lib/x86_64-linux-gnu/ (0x00007f4a54273000) => /lib/x86_64-linux-gnu/ (0x00007f4a5405d000)
/lib64/ (0x00007f4a55c31000) => /lib/x86_64-linux-gnu/ (0x00007f4a53e59000)

$ sudo ldd ./hpcc
[sudo] password for lml: => (0x00007fffc1d61000) => not found => /lib/x86_64-linux-gnu/ (0x00007fd9c81ad000) => /lib/x86_64-linux-gnu/ (0x00007fd9c7ea7000) => /lib/x86_64-linux-gnu/ (0x00007fd9c7ae2000)
/lib64/ (0x00007fd9c83cb000)

Why is not found when ldd is run with sudo command.
Because of this, when I run hpcc executable under sudo, I get following error.

$ sudo mpirun -np 4 ./hpcc
./hpcc: error while loading shared libraries: cannot open shared object file: No such file or directory

Thank you.
Old 01-04-2016, 04:44 AM   #2
Senior Member
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora, Alpine, Cirros, OpenSuse/SLES
Posts: 3,492

Rep: Reputation: 921Reputation: 921Reputation: 921Reputation: 921Reputation: 921Reputation: 921Reputation: 921Reputation: 921
Root doesn't know about libraries located in /home/lml. The environment variable LD_LIBRARY_PATH contains the directories to search for libraries; check its value for lml and for root.

Note that for security reasons the user's environment is not inherited by default when running sudo. This behaviour can be changed in the sudoers file.
1 members found this post helpful.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
lpstat command output difference on crontab hocheetiong Linux - Server 1 02-28-2013 07:55 PM
What is difference between Power broker utility and sudo command. pinga123 Linux - Newbie 4 08-12-2011 03:34 AM
LXer: How to properly redirect the output of command executed with sudo. LXer Syndicated Linux News 0 02-27-2011 11:50 PM
meaning of output of ldd command _Linux_Learner Linux - Newbie 3 11-16-2010 07:17 AM
Which ldd output is correct? kaz2100 Linux - General 1 08-24-2006 01:35 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:25 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration