Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've RPM file of which I want to examine its file contents. For .deb packages, I can use dpkg -x file.deb to extract it.

What is the equivalent command for a .rpm file? I'm looking for a command-line application.

share|improve this question
add comment

2 Answers

up vote 17 down vote accepted

file-roller seems to open rpm files. Alternatively you can use the command:

rpm2cpio /path/to/file.rpm | cpio -i --make-directories

that will extract the rpm content to the current directory

share|improve this answer
    
Thanks, I just came across it: rpm2cpio file.rpm | cpio --extract --make-directories –  Lekensteyn Jul 7 '11 at 20:57
add comment

As far as I remember you have to use a app called alien which transforms .rpm to deb files. Use a terminal to do :

sudo apt-get install alien

then

sudo alien -d nameofyourpackage.rpm (-d for Debian package)

If you then need to examine it you can resort to your dpkg -x file.deb method

share|improve this answer
    
rpm2cpio seems to work fine, so I haven't tried this one. –  Lekensteyn Jul 7 '11 at 21:01
1  
this has the drawback of creating a .deb first. –  enzotib Jul 7 '11 at 21:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.