LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to list just binaries provided by rpm package? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-list-just-binaries-provided-by-rpm-package-4175458991/)

Madhu Desai 04-21-2013 07:18 AM

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.

unSpawn 04-21-2013 08:00 AM

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.

Madhu Desai 04-22-2013 03:09 AM

@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!!!

unSpawn 04-22-2013 05:10 PM

You're welcome. BTW with the last one you could skip one binary and use
Code:

rpm -ql coreutils|egrep -c "(bin/|exec/)"
instead.


All times are GMT -5. The time now is 12:09 PM.