LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-08-2007, 06:01 PM   #1
linuxcrazyguy
LQ Newbie
 
Registered: Mar 2007
Posts: 28

Rep: Reputation: 15
How to list only files belong to a package


I know about dpkg -L packagename but it lists directories too eg. /lib which doesn't make sense to me.
Is there a simple way to get a list of ONLY FILES belonging to a package?

Thanks guys
 
Old 04-08-2007, 07:18 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
It makes sense because everything in UNIX/Linux is a "file". A directory is a special type of file. A device is a different type of file. A pipe is a different type of file.
 
Old 04-08-2007, 07:41 PM   #3
linuxcrazyguy
LQ Newbie
 
Registered: Mar 2007
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks jlightner but that doesn't help me , I only need normal (not special directory files) listed.

Does anyone have the answer to my question and how to easily achieve what I'm asking?

Thanks
 
Old 04-08-2007, 07:56 PM   #4
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Trying to imagine the usefulness of such information. It sounds to me like you're trying to identify a package to install which will supply a missing dependency for another package. You have to do that sort of thing with some distros. Debian's not like that.

I'm sure the command you mention in the OP gives the same information, but here's a link to all the files in the "gaim" (soon to be "pidgin") package. Of course it includes the entire path to the file in question.

Last edited by rickh; 04-09-2007 at 02:15 AM.
 
Old 04-08-2007, 08:02 PM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
It helps you by educating you about things that "make sense" to experienced users thereby eliminating misconceptions.

However although there don't seem to be any flags that would do what you want this short little script would (assuming the package is installed):

Code:
for file in `dpkg -L <packagename>`; do if [ -f $file ];    then echo $file;    fi; done
Just input the name of the package you want in place of <packagename>.

The script tests each file output from the dpkg -L to see if it is a regular file and then outputs it to your display if it is - if it isn't it won't display it.

Using [ -d $file ] in the above would show only the directories.
 
  


Reply


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
List files in a package before installing? humbletech99 Debian 3 06-02-2006 04:35 AM
List the files installed by a RPM package s_deepak_123 Linux - General 6 02-20-2006 01:14 PM
what package does a program belong to? eantoranz Ubuntu 4 08-11-2005 04:28 PM
Which package do these files belong to? dubya Linux - Software 6 12-28-2004 07:40 PM
find files that do not belong to any package? Pinchiukas Slackware 10 09-15-2004 08:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:21 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