Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 10-31-2004, 05:09 PM   #1
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Dissembling RPM files


I am wondering if there's a way to "dissemble" RPM package files. For instance, if the file called "daihard-1.0.i386.rpm" contains several shared object files (*.so), I'd like to extract them from the package file. I may know the exact names of the files, or I may only know the file extension. Is this possible at all?

Old 10-31-2004, 05:44 PM   #2
Registered: Aug 2004
Location: New York
Distribution: --------- Gentoo-2004.2 [2.6.8] Redhat-9 [2.6.6]
Posts: 545

Rep: Reputation: 31
When you get a new package, you may want to examine it to see what it offers. Using query mode, you can peek inside. To simply query a package and get some generic information about it, just simply:

rpm -qp (package)

This should bring just the name of the package. A much more useful method is to get the package information from the package itself:

rpm -qip (package)

This will bring up the author, build host and date, whether it's installed yet, etc, about a package. Also included is a summary about the package's functionality and features.

If you want to see what is really inside the package, what files are inside of it? Well, you can list the contents of a package, much like you would get the table of contents of a tar archive (using tar -tvf):

rpm -qlp (package)

This will list all of the files within the archive, using their full pathnames. I use this often to see what will be installed with a package, but most importantly where. I like to stick to conventions about putting stuff in their expected places, but some packagers do not.
Old 10-31-2004, 05:52 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you only want to extract a particular file from a package, such as a needed version of a library, but you don't want to install the package, you can use the Midnight Commander (mc). It will give you a directory like listing of the rpm contents, much like arc allows you to see the contents of a compressed tar or zip file.

Of course if you wish to use a library file, you will need to run ldconfig yourself.
And it may have a dependency that the RPM would normally provide.

Last edited by jschiwal; 10-31-2004 at 05:55 PM.
Old 10-31-2004, 09:34 PM   #4
Senior Member
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
And doing it from the command line:

rpm2cpio /path/to/rpm | cpio -ivd path/to/file

where "path/to/file" means the path to the file inside the rpm, and the command will create ./path/to/file in the current directory (so, do NOT issue the above command when you are in the root directory, or you risk accidentally overwriting the installed files).
Old 10-31-2004, 09:42 PM   #5
Registered: Aug 2004
Location: New York
Distribution: --------- Gentoo-2004.2 [2.6.8] Redhat-9 [2.6.6]
Posts: 545

Rep: Reputation: 31
Nice to know this is possible.. Cheers J_Szucs !!
Old 11-01-2004, 02:05 AM   #6
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Original Poster
Rep: Reputation: 34
Thanks all for your help! It's very nice to know there are different ways to approach this issue. My particular goal was to take this font RPM which contains a few nice-looking fonts and extract the actual font files to install on my Linux box. (I tried installing the package itself but it failed with some dependancy issues.)

I've been able to extract the necessary font files from the package following your advice. Thanks again!!!


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
rpm -Uvh does not work with header & rpm files in /var/spool/up2date jd_no7 Linux - Software 1 05-17-2004 05:24 PM
preserve configuration files during RPM upgrade (rpm -U) charrua Red Hat 3 03-14-2004 01:18 PM
How do you install tar/gz files, and rpm files? Fear58 Linux - Software 6 02-14-2004 04:35 PM
Difference between src.rpm files and source.rpm files ja_nch Red Hat 2 09-06-2003 06:12 PM
Building RPM files from TAR files parle Linux - Software 3 05-05-2002 11:02 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:31 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
Open Source Consulting | Domain Registration