Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 27 down vote accepted

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

$ sudo apt-get install rpm2cpio
$ 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

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


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
this has the drawback of creating a .deb first. – enzotib Jul 7 '11 at 21:16

Your Answer


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.