How to extract RPM from RPM database on Red Hat Enterprise Linux












8














Is there a way to extract an installed RPM from an RPM database on Red Hat Enterprise Linux to reproduce the original .rpm file?










share|improve this question















migrated from stackoverflow.com Jun 27 '11 at 22:13


This question came from our site for professional and enthusiast programmers.















  • Why was this title modified? Red Hat is the name of the software not RedcHat
    – Ramhound
    Dec 13 '18 at 1:40


















8














Is there a way to extract an installed RPM from an RPM database on Red Hat Enterprise Linux to reproduce the original .rpm file?










share|improve this question















migrated from stackoverflow.com Jun 27 '11 at 22:13


This question came from our site for professional and enthusiast programmers.















  • Why was this title modified? Red Hat is the name of the software not RedcHat
    – Ramhound
    Dec 13 '18 at 1:40
















8












8








8


2





Is there a way to extract an installed RPM from an RPM database on Red Hat Enterprise Linux to reproduce the original .rpm file?










share|improve this question















Is there a way to extract an installed RPM from an RPM database on Red Hat Enterprise Linux to reproduce the original .rpm file?







redhat-enterprise-linux rpm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 13 '18 at 1:45









Ramhound

19.5k156085




19.5k156085










asked Oct 10 '08 at 12:45









John in MD

14415




14415




migrated from stackoverflow.com Jun 27 '11 at 22:13


This question came from our site for professional and enthusiast programmers.






migrated from stackoverflow.com Jun 27 '11 at 22:13


This question came from our site for professional and enthusiast programmers.














  • Why was this title modified? Red Hat is the name of the software not RedcHat
    – Ramhound
    Dec 13 '18 at 1:40




















  • Why was this title modified? Red Hat is the name of the software not RedcHat
    – Ramhound
    Dec 13 '18 at 1:40


















Why was this title modified? Red Hat is the name of the software not RedcHat
– Ramhound
Dec 13 '18 at 1:40






Why was this title modified? Red Hat is the name of the software not RedcHat
– Ramhound
Dec 13 '18 at 1:40












2 Answers
2






active

oldest

votes


















7














If you want to save a copy of the package as currently installed before upgrading or removing it, use rpm --repackage -- it'll save the RPMs in /var/tmp or /var/spool/repackage or elsewhere, depending on your configuration.



Otherwise, there exists rpmrebuild, which does exactly what you ask for.



Word of caution: with neither of these tools do you obtain the exact same *.rpm as the one you started from. Any changes to the installed files belong to the package will be in the RPMs generated.






share|improve this answer

















  • 1




    I believe it's worthwhile to note that rpm --repackage will Re-package the files before erasing rpm.org/max-rpm-snapshot/rpm.8.html I almost ran this command blindly, but looked at the linked docs first.
    – Kevin Meredith
    May 31 '13 at 12:25










  • rpm --repackage doesn't appear to be available on newer (e.g., RHEL 7) systems. rpmrebuild is available in the EPEL for RHEL 7 and did the trick for me.
    – jayhendren
    Dec 28 '17 at 19:54



















1














Producing the original rpm file isn't possible, it's been extracted and possibly discarded. The rpm database has information about what files it's installed and their checksums, permissions, and the postinst scripts:



# verify package contents
rpm -q packagename --verify
# read the scripts that run on installation and removal
rpm -q packagename --scripts


will give you some information.



If you want to obtain an rpm from the respository, I recommend using yumdownloader, from the yum-utils package.



yum install yum-utils
yumdownloader packagename


This will download the latest rpm, not the one that is installed currently.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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',
    autoActivateHeartbeat: false,
    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%2fsuperuser.com%2fquestions%2f303083%2fhow-to-extract-rpm-from-rpm-database-on-red-hat-enterprise-linux%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    7














    If you want to save a copy of the package as currently installed before upgrading or removing it, use rpm --repackage -- it'll save the RPMs in /var/tmp or /var/spool/repackage or elsewhere, depending on your configuration.



    Otherwise, there exists rpmrebuild, which does exactly what you ask for.



    Word of caution: with neither of these tools do you obtain the exact same *.rpm as the one you started from. Any changes to the installed files belong to the package will be in the RPMs generated.






    share|improve this answer

















    • 1




      I believe it's worthwhile to note that rpm --repackage will Re-package the files before erasing rpm.org/max-rpm-snapshot/rpm.8.html I almost ran this command blindly, but looked at the linked docs first.
      – Kevin Meredith
      May 31 '13 at 12:25










    • rpm --repackage doesn't appear to be available on newer (e.g., RHEL 7) systems. rpmrebuild is available in the EPEL for RHEL 7 and did the trick for me.
      – jayhendren
      Dec 28 '17 at 19:54
















    7














    If you want to save a copy of the package as currently installed before upgrading or removing it, use rpm --repackage -- it'll save the RPMs in /var/tmp or /var/spool/repackage or elsewhere, depending on your configuration.



    Otherwise, there exists rpmrebuild, which does exactly what you ask for.



    Word of caution: with neither of these tools do you obtain the exact same *.rpm as the one you started from. Any changes to the installed files belong to the package will be in the RPMs generated.






    share|improve this answer

















    • 1




      I believe it's worthwhile to note that rpm --repackage will Re-package the files before erasing rpm.org/max-rpm-snapshot/rpm.8.html I almost ran this command blindly, but looked at the linked docs first.
      – Kevin Meredith
      May 31 '13 at 12:25










    • rpm --repackage doesn't appear to be available on newer (e.g., RHEL 7) systems. rpmrebuild is available in the EPEL for RHEL 7 and did the trick for me.
      – jayhendren
      Dec 28 '17 at 19:54














    7












    7








    7






    If you want to save a copy of the package as currently installed before upgrading or removing it, use rpm --repackage -- it'll save the RPMs in /var/tmp or /var/spool/repackage or elsewhere, depending on your configuration.



    Otherwise, there exists rpmrebuild, which does exactly what you ask for.



    Word of caution: with neither of these tools do you obtain the exact same *.rpm as the one you started from. Any changes to the installed files belong to the package will be in the RPMs generated.






    share|improve this answer












    If you want to save a copy of the package as currently installed before upgrading or removing it, use rpm --repackage -- it'll save the RPMs in /var/tmp or /var/spool/repackage or elsewhere, depending on your configuration.



    Otherwise, there exists rpmrebuild, which does exactly what you ask for.



    Word of caution: with neither of these tools do you obtain the exact same *.rpm as the one you started from. Any changes to the installed files belong to the package will be in the RPMs generated.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Oct 10 '08 at 14:32









    ephemient

    19k42319




    19k42319








    • 1




      I believe it's worthwhile to note that rpm --repackage will Re-package the files before erasing rpm.org/max-rpm-snapshot/rpm.8.html I almost ran this command blindly, but looked at the linked docs first.
      – Kevin Meredith
      May 31 '13 at 12:25










    • rpm --repackage doesn't appear to be available on newer (e.g., RHEL 7) systems. rpmrebuild is available in the EPEL for RHEL 7 and did the trick for me.
      – jayhendren
      Dec 28 '17 at 19:54














    • 1




      I believe it's worthwhile to note that rpm --repackage will Re-package the files before erasing rpm.org/max-rpm-snapshot/rpm.8.html I almost ran this command blindly, but looked at the linked docs first.
      – Kevin Meredith
      May 31 '13 at 12:25










    • rpm --repackage doesn't appear to be available on newer (e.g., RHEL 7) systems. rpmrebuild is available in the EPEL for RHEL 7 and did the trick for me.
      – jayhendren
      Dec 28 '17 at 19:54








    1




    1




    I believe it's worthwhile to note that rpm --repackage will Re-package the files before erasing rpm.org/max-rpm-snapshot/rpm.8.html I almost ran this command blindly, but looked at the linked docs first.
    – Kevin Meredith
    May 31 '13 at 12:25




    I believe it's worthwhile to note that rpm --repackage will Re-package the files before erasing rpm.org/max-rpm-snapshot/rpm.8.html I almost ran this command blindly, but looked at the linked docs first.
    – Kevin Meredith
    May 31 '13 at 12:25












    rpm --repackage doesn't appear to be available on newer (e.g., RHEL 7) systems. rpmrebuild is available in the EPEL for RHEL 7 and did the trick for me.
    – jayhendren
    Dec 28 '17 at 19:54




    rpm --repackage doesn't appear to be available on newer (e.g., RHEL 7) systems. rpmrebuild is available in the EPEL for RHEL 7 and did the trick for me.
    – jayhendren
    Dec 28 '17 at 19:54













    1














    Producing the original rpm file isn't possible, it's been extracted and possibly discarded. The rpm database has information about what files it's installed and their checksums, permissions, and the postinst scripts:



    # verify package contents
    rpm -q packagename --verify
    # read the scripts that run on installation and removal
    rpm -q packagename --scripts


    will give you some information.



    If you want to obtain an rpm from the respository, I recommend using yumdownloader, from the yum-utils package.



    yum install yum-utils
    yumdownloader packagename


    This will download the latest rpm, not the one that is installed currently.






    share|improve this answer


























      1














      Producing the original rpm file isn't possible, it's been extracted and possibly discarded. The rpm database has information about what files it's installed and their checksums, permissions, and the postinst scripts:



      # verify package contents
      rpm -q packagename --verify
      # read the scripts that run on installation and removal
      rpm -q packagename --scripts


      will give you some information.



      If you want to obtain an rpm from the respository, I recommend using yumdownloader, from the yum-utils package.



      yum install yum-utils
      yumdownloader packagename


      This will download the latest rpm, not the one that is installed currently.






      share|improve this answer
























        1












        1








        1






        Producing the original rpm file isn't possible, it's been extracted and possibly discarded. The rpm database has information about what files it's installed and their checksums, permissions, and the postinst scripts:



        # verify package contents
        rpm -q packagename --verify
        # read the scripts that run on installation and removal
        rpm -q packagename --scripts


        will give you some information.



        If you want to obtain an rpm from the respository, I recommend using yumdownloader, from the yum-utils package.



        yum install yum-utils
        yumdownloader packagename


        This will download the latest rpm, not the one that is installed currently.






        share|improve this answer












        Producing the original rpm file isn't possible, it's been extracted and possibly discarded. The rpm database has information about what files it's installed and their checksums, permissions, and the postinst scripts:



        # verify package contents
        rpm -q packagename --verify
        # read the scripts that run on installation and removal
        rpm -q packagename --scripts


        will give you some information.



        If you want to obtain an rpm from the respository, I recommend using yumdownloader, from the yum-utils package.



        yum install yum-utils
        yumdownloader packagename


        This will download the latest rpm, not the one that is installed currently.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 10 '08 at 13:02







        Jerub





































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • 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%2fsuperuser.com%2fquestions%2f303083%2fhow-to-extract-rpm-from-rpm-database-on-red-hat-enterprise-linux%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

            Paul Cézanne

            UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

            Angular material date-picker (MatDatepicker) auto completes the date on focus out