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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-31-2004, 05:09 PM
|
#1
|
Member
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915
Rep:
|
Dissembling RPM files
Hi.
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?
Thanks!
Dai
|
|
|
10-31-2004, 05:44 PM
|
#2
|
Member
Registered: Aug 2004
Location: New York
Distribution: --------- Gentoo-2004.2 [2.6.8] Redhat-9 [2.6.6]
Posts: 545
Rep:
|
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.
|
|
|
10-31-2004, 05:52 PM
|
#3
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
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:
|
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).
|
|
|
10-31-2004, 09:42 PM
|
#5
|
Member
Registered: Aug 2004
Location: New York
Distribution: --------- Gentoo-2004.2 [2.6.8] Redhat-9 [2.6.6]
Posts: 545
Rep:
|
Nice to know this is possible.. Cheers J_Szucs !!
|
|
|
11-01-2004, 02:05 AM
|
#6
|
Member
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915
Original Poster
Rep:
|
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!!!
|
|
|
All times are GMT -5. The time now is 09:01 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|