LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-13-2006, 01:49 PM   #1
ssnodgra
LQ Newbie
 
Registered: Nov 2005
Posts: 4

Rep: Reputation: 0
How to figure out what dependencies a binary uses


What I am trying to do is figure out what deps, well, really what files a binary uses. Like a trace or something. I tried ldd it did not give me what I was looking for. Thanks.
 
Old 01-13-2006, 02:18 PM   #2
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by ssnodgra
What I am trying to do is figure out what deps, well, really what files a binary uses. Like a trace or something. I tried ldd it did not give me what I was looking for. Thanks.
If the binary is running, get is PID using the "ps" command and then use "lsof" to show what files it has open. But I don't know if this is exactly what you're looking for or not.

e.g.,
Code:
ps -ef | grep bash
... say this returns "26312" ... then run:
Code:
lsof -p 26312
You will need to be root to fully trace out some processes if you don't own them.
 
Old 01-13-2006, 02:18 PM   #3
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
the best thing to do would be to go to the website of the software developer, try google first and then sourceforge.net and look for the software by name. MOst packages have instructions to install from source, and with that, the needed dependencies.
good luck!
 
Old 01-13-2006, 02:19 PM   #4
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Houston, TX
Distribution: Arch
Posts: 1,381

Rep: Reputation: 47
www.rpm-seek.com is a decent site to tell you what depends, supplies, etc. I dont' use rpm distros, but that site has come in handy a few times with dependencies.
 
Old 01-13-2006, 02:25 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
"...what files a binary uses..."
Well I can see by the responses that this is an ambiguous question. I thought you were asking what files a running binary uses, and others thought you were asking what files you need to compile a specific binary. I guess you should specify (well actually, answers to both are here already!)

;-)
 
Old 01-13-2006, 02:59 PM   #6
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by ssnodgra
What I am trying to do is figure out what deps, well, really what files a binary uses. Like a trace or something. I tried ldd it did not give me what I was looking for. Thanks.
objdump -x /path/to/binary | grep NEEDED maybe what you are looking for...
 
Old 01-13-2006, 03:42 PM   #7
ssnodgra
LQ Newbie
 
Registered: Nov 2005
Posts: 4

Original Poster
Rep: Reputation: 0
You guys are awsome. I can peice together what I need by using the two commands below.
Thanks a million guys.

ps aux | grep <whatever> | awk '{print $2}' | xargs -n1 lsof -p > deps.out

objdump -x /path/to/binary | grep
 
  


Reply



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
cant figure out megadsonic Linux - Networking 7 12-18-2005 02:19 AM
Cant figure this out. e_larkin Linux - Software 2 07-24-2004 03:50 PM
I recieve a failed dependencies error, but I have all required dependencies Laptop2250 Linux - Software 15 02-03-2004 07:58 PM
Can anyone Figure this out? BajaNick LQ Suggestions & Feedback 17 12-16-2003 11:36 PM
I can't figure it out NightWolf_NZ Linux - Hardware 1 09-10-2003 10:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:24 AM.

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