How do I extract a RPM file?











up vote
31
down vote

favorite
4












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
    31
    down vote

    favorite
    4












    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
      31
      down vote

      favorite
      4









      up vote
      31
      down vote

      favorite
      4






      4





      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













      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.







      extract rpm






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 7 '11 at 20:44









      Lekensteyn

      119k47262354




      119k47262354






















          4 Answers
          4






          active

          oldest

          votes

















          up vote
          42
          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


















          up vote
          5
          down vote













          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


















          up vote
          1
          down vote













          You can also use alien to only extract the files (which it calls "generate a build tree")



          alien --scripts --generate <package.rpm>



          You will get 2 dirs - <package>, and <package>.orig, which is the raw extraction from the rpm.






          share|improve this answer




























            up vote
            0
            down vote













            Install 7z:



            apt install p7zip-full


            and extract:



            7z x /path/to/file.rpm 
            7z x /path/to/file.cpio -o/path/to/extract/folder/





            share|improve this answer





















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f52230%2fhow-do-i-extract-a-rpm-file%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              42
              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















              up vote
              42
              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













              up vote
              42
              down vote



              accepted







              up vote
              42
              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














              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














              share|improve this answer



              share|improve this answer








              edited Feb 6 '15 at 9:42









              malat

              38138




              38138










              answered Jul 7 '11 at 20:54









              enzotib

              62.1k5131153




              62.1k5131153












              • Thanks, I just came across it: rpm2cpio file.rpm | cpio --extract --make-directories
                – Lekensteyn
                Jul 7 '11 at 20:57


















              • Thanks, I just came across it: rpm2cpio file.rpm | cpio --extract --make-directories
                – Lekensteyn
                Jul 7 '11 at 20:57
















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




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












              up vote
              5
              down vote













              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















              up vote
              5
              down vote













              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













              up vote
              5
              down vote










              up vote
              5
              down vote









              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














              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














              share|improve this answer



              share|improve this answer








              edited Jul 7 '11 at 21:19

























              answered Jul 7 '11 at 20:57









              andybleaden

              1,745923




              1,745923












              • 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


















              • 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
















              rpm2cpio seems to work fine, so I haven't tried this one.
              – Lekensteyn
              Jul 7 '11 at 21:01




              rpm2cpio seems to work fine, so I haven't tried this one.
              – Lekensteyn
              Jul 7 '11 at 21:01




              1




              1




              this has the drawback of creating a .deb first.
              – enzotib
              Jul 7 '11 at 21:16




              this has the drawback of creating a .deb first.
              – enzotib
              Jul 7 '11 at 21:16










              up vote
              1
              down vote













              You can also use alien to only extract the files (which it calls "generate a build tree")



              alien --scripts --generate <package.rpm>



              You will get 2 dirs - <package>, and <package>.orig, which is the raw extraction from the rpm.






              share|improve this answer

























                up vote
                1
                down vote













                You can also use alien to only extract the files (which it calls "generate a build tree")



                alien --scripts --generate <package.rpm>



                You will get 2 dirs - <package>, and <package>.orig, which is the raw extraction from the rpm.






                share|improve this answer























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  You can also use alien to only extract the files (which it calls "generate a build tree")



                  alien --scripts --generate <package.rpm>



                  You will get 2 dirs - <package>, and <package>.orig, which is the raw extraction from the rpm.






                  share|improve this answer












                  You can also use alien to only extract the files (which it calls "generate a build tree")



                  alien --scripts --generate <package.rpm>



                  You will get 2 dirs - <package>, and <package>.orig, which is the raw extraction from the rpm.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 1 '17 at 18:40









                  Randall

                  16619




                  16619






















                      up vote
                      0
                      down vote













                      Install 7z:



                      apt install p7zip-full


                      and extract:



                      7z x /path/to/file.rpm 
                      7z x /path/to/file.cpio -o/path/to/extract/folder/





                      share|improve this answer

























                        up vote
                        0
                        down vote













                        Install 7z:



                        apt install p7zip-full


                        and extract:



                        7z x /path/to/file.rpm 
                        7z x /path/to/file.cpio -o/path/to/extract/folder/





                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          Install 7z:



                          apt install p7zip-full


                          and extract:



                          7z x /path/to/file.rpm 
                          7z x /path/to/file.cpio -o/path/to/extract/folder/





                          share|improve this answer












                          Install 7z:



                          apt install p7zip-full


                          and extract:



                          7z x /path/to/file.rpm 
                          7z x /path/to/file.cpio -o/path/to/extract/folder/






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 22 at 9:41









                          Pavel P.

                          1




                          1






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f52230%2fhow-do-i-extract-a-rpm-file%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

                              How to change which sound is reproduced for terminal bell?

                              Can I use Tabulator js library in my java Spring + Thymeleaf project?