how to remove all installed dependent packages while removing a package in centos 7?












6















I am using CentOS 7. I installed okular, which is a PDF viewer, with the command:



sudo yum install okular


As you can see in the picture below, it installed 37 dependent packages to install okular.



installed dependencies



But I wasn't satisfied with the features of the application and I decided to remove it. The problem is that if I remove it with the command:



sudo yum autoremove okular


It only removes four dependent packages.



removed packages with autoremove



And if I remove it with the command:



sudo yum remove okular


It removes only one package which is okular.x86_64.



Now, my question is that is there a way to remove all 37 installed packages with a command or do I have to remove all of them one by one?










share|improve this question





























    6















    I am using CentOS 7. I installed okular, which is a PDF viewer, with the command:



    sudo yum install okular


    As you can see in the picture below, it installed 37 dependent packages to install okular.



    installed dependencies



    But I wasn't satisfied with the features of the application and I decided to remove it. The problem is that if I remove it with the command:



    sudo yum autoremove okular


    It only removes four dependent packages.



    removed packages with autoremove



    And if I remove it with the command:



    sudo yum remove okular


    It removes only one package which is okular.x86_64.



    Now, my question is that is there a way to remove all 37 installed packages with a command or do I have to remove all of them one by one?










    share|improve this question



























      6












      6








      6


      1






      I am using CentOS 7. I installed okular, which is a PDF viewer, with the command:



      sudo yum install okular


      As you can see in the picture below, it installed 37 dependent packages to install okular.



      installed dependencies



      But I wasn't satisfied with the features of the application and I decided to remove it. The problem is that if I remove it with the command:



      sudo yum autoremove okular


      It only removes four dependent packages.



      removed packages with autoremove



      And if I remove it with the command:



      sudo yum remove okular


      It removes only one package which is okular.x86_64.



      Now, my question is that is there a way to remove all 37 installed packages with a command or do I have to remove all of them one by one?










      share|improve this question
















      I am using CentOS 7. I installed okular, which is a PDF viewer, with the command:



      sudo yum install okular


      As you can see in the picture below, it installed 37 dependent packages to install okular.



      installed dependencies



      But I wasn't satisfied with the features of the application and I decided to remove it. The problem is that if I remove it with the command:



      sudo yum autoremove okular


      It only removes four dependent packages.



      removed packages with autoremove



      And if I remove it with the command:



      sudo yum remove okular


      It removes only one package which is okular.x86_64.



      Now, my question is that is there a way to remove all 37 installed packages with a command or do I have to remove all of them one by one?







      centos terminal yum dependencies uninstall






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago









      Rui F Ribeiro

      39.6k1479132




      39.6k1479132










      asked Aug 16 '16 at 15:26









      ukllukll

      2921214




      2921214






















          2 Answers
          2






          active

          oldest

          votes


















          10














          Personally, I don't like yum plugins because they don't work a lot of the time, in my experience.



          You can use the yum history command to view your yum history.



          [root@testbox ~]# yum history
          Loaded plugins: product-id, rhnplugin, search-disabled-repos, subscription-manager, verify, versionlock
          ID | Login user | Date and time | Action(s) | Altered
          ----------------------------------------------------------------------------------
          19 | Jason <jason> | 2016-06-28 09:16 | Install | 10


          You can find info about the transaction by doing yum history info <transaction id>. So:



          yum history info 19 would tell you all the packages that were installed with transaction 19 and the command line that was used to install the packages. If you want to undo transaction 19, you would run yum history undo 19.



          Alternatively, if you just wanted to undo the last transaction you did (you installed a software package and didn't like it), you could just do yum history undo last



          Hope this helps!






          share|improve this answer
























          • Firstly, thank you for your excellent answer. And secondly, when I did sudo yum history, it showed only actions with id 30 through 49. Is there a way to view all actions history (including with id 1-29)?

            – ukll
            Aug 16 '16 at 18:34








          • 1





            You're welcome! Yes, there is a way to show all of your history. Just do yum history list all.

            – Jason Powell
            Aug 16 '16 at 19:00



















          4














          yum remove package_name will remove only that package and all their dependencies.



          yum autoremove will remove the unused dependencies



          To remove a package with it's dependencies , you need to install yum plugin called: remove-with-leaves



          To install it type:



          yum install yum-plugin-remove-with-leaves


          To remove package_name type:



          yum remove package_name --remove-leaves





          share|improve this answer
























          • I tried your answer, it doesn't work.

            – ukll
            Aug 16 '16 at 16:22











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2funix.stackexchange.com%2fquestions%2f303754%2fhow-to-remove-all-installed-dependent-packages-while-removing-a-package-in-cento%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









          10














          Personally, I don't like yum plugins because they don't work a lot of the time, in my experience.



          You can use the yum history command to view your yum history.



          [root@testbox ~]# yum history
          Loaded plugins: product-id, rhnplugin, search-disabled-repos, subscription-manager, verify, versionlock
          ID | Login user | Date and time | Action(s) | Altered
          ----------------------------------------------------------------------------------
          19 | Jason <jason> | 2016-06-28 09:16 | Install | 10


          You can find info about the transaction by doing yum history info <transaction id>. So:



          yum history info 19 would tell you all the packages that were installed with transaction 19 and the command line that was used to install the packages. If you want to undo transaction 19, you would run yum history undo 19.



          Alternatively, if you just wanted to undo the last transaction you did (you installed a software package and didn't like it), you could just do yum history undo last



          Hope this helps!






          share|improve this answer
























          • Firstly, thank you for your excellent answer. And secondly, when I did sudo yum history, it showed only actions with id 30 through 49. Is there a way to view all actions history (including with id 1-29)?

            – ukll
            Aug 16 '16 at 18:34








          • 1





            You're welcome! Yes, there is a way to show all of your history. Just do yum history list all.

            – Jason Powell
            Aug 16 '16 at 19:00
















          10














          Personally, I don't like yum plugins because they don't work a lot of the time, in my experience.



          You can use the yum history command to view your yum history.



          [root@testbox ~]# yum history
          Loaded plugins: product-id, rhnplugin, search-disabled-repos, subscription-manager, verify, versionlock
          ID | Login user | Date and time | Action(s) | Altered
          ----------------------------------------------------------------------------------
          19 | Jason <jason> | 2016-06-28 09:16 | Install | 10


          You can find info about the transaction by doing yum history info <transaction id>. So:



          yum history info 19 would tell you all the packages that were installed with transaction 19 and the command line that was used to install the packages. If you want to undo transaction 19, you would run yum history undo 19.



          Alternatively, if you just wanted to undo the last transaction you did (you installed a software package and didn't like it), you could just do yum history undo last



          Hope this helps!






          share|improve this answer
























          • Firstly, thank you for your excellent answer. And secondly, when I did sudo yum history, it showed only actions with id 30 through 49. Is there a way to view all actions history (including with id 1-29)?

            – ukll
            Aug 16 '16 at 18:34








          • 1





            You're welcome! Yes, there is a way to show all of your history. Just do yum history list all.

            – Jason Powell
            Aug 16 '16 at 19:00














          10












          10








          10







          Personally, I don't like yum plugins because they don't work a lot of the time, in my experience.



          You can use the yum history command to view your yum history.



          [root@testbox ~]# yum history
          Loaded plugins: product-id, rhnplugin, search-disabled-repos, subscription-manager, verify, versionlock
          ID | Login user | Date and time | Action(s) | Altered
          ----------------------------------------------------------------------------------
          19 | Jason <jason> | 2016-06-28 09:16 | Install | 10


          You can find info about the transaction by doing yum history info <transaction id>. So:



          yum history info 19 would tell you all the packages that were installed with transaction 19 and the command line that was used to install the packages. If you want to undo transaction 19, you would run yum history undo 19.



          Alternatively, if you just wanted to undo the last transaction you did (you installed a software package and didn't like it), you could just do yum history undo last



          Hope this helps!






          share|improve this answer













          Personally, I don't like yum plugins because they don't work a lot of the time, in my experience.



          You can use the yum history command to view your yum history.



          [root@testbox ~]# yum history
          Loaded plugins: product-id, rhnplugin, search-disabled-repos, subscription-manager, verify, versionlock
          ID | Login user | Date and time | Action(s) | Altered
          ----------------------------------------------------------------------------------
          19 | Jason <jason> | 2016-06-28 09:16 | Install | 10


          You can find info about the transaction by doing yum history info <transaction id>. So:



          yum history info 19 would tell you all the packages that were installed with transaction 19 and the command line that was used to install the packages. If you want to undo transaction 19, you would run yum history undo 19.



          Alternatively, if you just wanted to undo the last transaction you did (you installed a software package and didn't like it), you could just do yum history undo last



          Hope this helps!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 16 '16 at 17:25









          Jason PowellJason Powell

          1814




          1814













          • Firstly, thank you for your excellent answer. And secondly, when I did sudo yum history, it showed only actions with id 30 through 49. Is there a way to view all actions history (including with id 1-29)?

            – ukll
            Aug 16 '16 at 18:34








          • 1





            You're welcome! Yes, there is a way to show all of your history. Just do yum history list all.

            – Jason Powell
            Aug 16 '16 at 19:00



















          • Firstly, thank you for your excellent answer. And secondly, when I did sudo yum history, it showed only actions with id 30 through 49. Is there a way to view all actions history (including with id 1-29)?

            – ukll
            Aug 16 '16 at 18:34








          • 1





            You're welcome! Yes, there is a way to show all of your history. Just do yum history list all.

            – Jason Powell
            Aug 16 '16 at 19:00

















          Firstly, thank you for your excellent answer. And secondly, when I did sudo yum history, it showed only actions with id 30 through 49. Is there a way to view all actions history (including with id 1-29)?

          – ukll
          Aug 16 '16 at 18:34







          Firstly, thank you for your excellent answer. And secondly, when I did sudo yum history, it showed only actions with id 30 through 49. Is there a way to view all actions history (including with id 1-29)?

          – ukll
          Aug 16 '16 at 18:34






          1




          1





          You're welcome! Yes, there is a way to show all of your history. Just do yum history list all.

          – Jason Powell
          Aug 16 '16 at 19:00





          You're welcome! Yes, there is a way to show all of your history. Just do yum history list all.

          – Jason Powell
          Aug 16 '16 at 19:00













          4














          yum remove package_name will remove only that package and all their dependencies.



          yum autoremove will remove the unused dependencies



          To remove a package with it's dependencies , you need to install yum plugin called: remove-with-leaves



          To install it type:



          yum install yum-plugin-remove-with-leaves


          To remove package_name type:



          yum remove package_name --remove-leaves





          share|improve this answer
























          • I tried your answer, it doesn't work.

            – ukll
            Aug 16 '16 at 16:22
















          4














          yum remove package_name will remove only that package and all their dependencies.



          yum autoremove will remove the unused dependencies



          To remove a package with it's dependencies , you need to install yum plugin called: remove-with-leaves



          To install it type:



          yum install yum-plugin-remove-with-leaves


          To remove package_name type:



          yum remove package_name --remove-leaves





          share|improve this answer
























          • I tried your answer, it doesn't work.

            – ukll
            Aug 16 '16 at 16:22














          4












          4








          4







          yum remove package_name will remove only that package and all their dependencies.



          yum autoremove will remove the unused dependencies



          To remove a package with it's dependencies , you need to install yum plugin called: remove-with-leaves



          To install it type:



          yum install yum-plugin-remove-with-leaves


          To remove package_name type:



          yum remove package_name --remove-leaves





          share|improve this answer













          yum remove package_name will remove only that package and all their dependencies.



          yum autoremove will remove the unused dependencies



          To remove a package with it's dependencies , you need to install yum plugin called: remove-with-leaves



          To install it type:



          yum install yum-plugin-remove-with-leaves


          To remove package_name type:



          yum remove package_name --remove-leaves






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 16 '16 at 16:16









          GAD3RGAD3R

          26.3k1752108




          26.3k1752108













          • I tried your answer, it doesn't work.

            – ukll
            Aug 16 '16 at 16:22



















          • I tried your answer, it doesn't work.

            – ukll
            Aug 16 '16 at 16:22

















          I tried your answer, it doesn't work.

          – ukll
          Aug 16 '16 at 16:22





          I tried your answer, it doesn't work.

          – ukll
          Aug 16 '16 at 16:22


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • 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%2funix.stackexchange.com%2fquestions%2f303754%2fhow-to-remove-all-installed-dependent-packages-while-removing-a-package-in-cento%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

          Loup dans la culture

          How to solve the problem of ntp “Unable to contact time server” from KDE?

          ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux