LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-21-2013, 08:18 AM   #1
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 512

Rep: Reputation: 139Reputation: 139
How to list just binaries provided by rpm package?


hi

i'm studying package management, and just wondering is there any way i can check what binaries are provided by certain rpm package?

For example,

'rpm -qd httpd' lists docfiles, 'rpm -qc httpd' lists config files and 'rpm -ql httpd' lists all files (total of 357 files).

If there were patterns like *.so or *.html, i could have used grep. but given that binaries will don't have any extension or any kind of pattern, how will i know what binaries are provided by certain rpm package?

Note: looked man page for rpm. has no such options. just hoping for any other way...

Thanks.

Last edited by mddnix; 04-21-2013 at 08:19 AM.
 
Old 04-21-2013, 09:00 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
You could do something like
Code:
rpm -ql packagename|egrep "(${PATH//:/|}|exec)"
or
Code:
rpm -ql packagename|egrep "(bin/|exec/)
though it doesn't cover binaries outside of the scope of RPM, relocations and other (path-related) oddities.
 
1 members found this post helpful.
Old 04-22-2013, 04:09 AM   #3
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 512

Original Poster
Rep: Reputation: 139Reputation: 139
@unSpawn

Great!!! that did the job.

i stick with second command. first command, if there is 'bin' or 'exec' in filename it is also displayed. but the second one does not.

Code:
# rpm -ql httpd|egrep "(${PATH//:/|}|exec)"
/usr/lib64/httpd/modules/mod_suexec.so
/usr/sbin/apachectl
/usr/sbin/htcacheclean
/usr/sbin/httpd
/usr/sbin/httpd.event
/usr/sbin/httpd.worker
/usr/sbin/httxt2dbm
/usr/sbin/rotatelogs
/usr/sbin/suexec
/usr/share/man/man8/suexec.8.gz
/var/www/icons/binary.gif
/var/www/icons/binary.png
/var/www/icons/binhex.gif
/var/www/icons/binhex.png
/var/www/icons/small/binary.gif
/var/www/icons/small/binary.png
/var/www/icons/small/binhex.gif
/var/www/icons/small/binhex.png

# rpm -ql httpd|egrep "(bin/|exec/)"
/usr/sbin/apachectl
/usr/sbin/htcacheclean
/usr/sbin/httpd
/usr/sbin/httpd.event
/usr/sbin/httpd.worker
/usr/sbin/httxt2dbm
/usr/sbin/rotatelogs
/usr/sbin/suexec

# rpm -ql coreutils | wc -l
349

# rpm -ql coreutils|egrep "(bin/|exec/)" | wc -l
105
Thanks!!!

Last edited by mddnix; 04-22-2013 at 04:16 AM.
 
Old 04-22-2013, 06:10 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
You're welcome. BTW with the last one you could skip one binary and use
Code:
rpm -ql coreutils|egrep -c "(bin/|exec/)"
instead.
 
1 members found this post helpful.
  


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
[SOLVED] RPM Query: List installed package without dependencies limdel Linux - General 6 10-22-2012 05:37 AM
[SOLVED] centos rpm package description list? hadimotamedi Linux - Newbie 2 09-04-2011 05:05 AM
Get rpm package file list and config informations tobiasw Linux - Newbie 1 10-22-2006 06:39 PM
List the files installed by a RPM package s_deepak_123 Linux - General 6 02-20-2006 01:14 PM
RPM in Slackware package list mpelts Slackware 1 09-01-2003 03:57 PM


All times are GMT -5. The time now is 04:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration