Find which Debian packages are only installed because they are recommended or suggested

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












On Debian I can use apt-get autoremove to remove packages that are no longer needed, i.e., that are not a dependency of any "manually installed" package. However, this does not remove packages that are merely "suggested" or "recommended" by manually installed packages. How can I find out the list of such packages on my system?










share|improve this question



























    up vote
    0
    down vote

    favorite












    On Debian I can use apt-get autoremove to remove packages that are no longer needed, i.e., that are not a dependency of any "manually installed" package. However, this does not remove packages that are merely "suggested" or "recommended" by manually installed packages. How can I find out the list of such packages on my system?










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      On Debian I can use apt-get autoremove to remove packages that are no longer needed, i.e., that are not a dependency of any "manually installed" package. However, this does not remove packages that are merely "suggested" or "recommended" by manually installed packages. How can I find out the list of such packages on my system?










      share|improve this question















      On Debian I can use apt-get autoremove to remove packages that are no longer needed, i.e., that are not a dependency of any "manually installed" package. However, this does not remove packages that are merely "suggested" or "recommended" by manually installed packages. How can I find out the list of such packages on my system?







      debian apt package-management dependencies






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 9 '17 at 23:20









      Jeff Schaller

      32.3k849109




      32.3k849109










      asked Oct 9 '17 at 23:08









      a3nm

      5,13831219




      5,13831219




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          You can also tell apt-get autoremove to ignore “Recommends” and “Suggests”:



          sudo apt-get autoremove -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false


          Use -s to get a list of the removals this would lead to without actually changing anything:



          sudo apt-get autoremove -s -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false





          share|improve this answer




















          • Thanks a lot! I think this is a much better solution than the one I proposed. Somehow, though, this does not return the same set of packages (it mostly returns more, but it also misses a few that deborphan found).
            – a3nm
            Oct 10 '17 at 9:45










          • The difference in output should be explained by your manual selections: deborphan ignores those, so it will find packages you no longer need but that are marked as manually installed. Basically that means you need to periodically review the output of apt-mark showmanual and mark packages you don’t explicitly need as automatically installed; then if they are in practice no longer necessary, autoremove will suggest their removal.
            – Stephen Kitt
            Oct 10 '17 at 11:16










          • Sure, thanks! (In fact, I already have scripts that periodically compare how apt-mark showmanual differs from a list that I maintain separately.) However, my point was that the output of your method is not the same as the output of my method even when I take the output of deborphan and specifically remove the manually installed packages (as per the command that I suggested). So I guess there must be some difference in how these two commands compute their output.
            – a3nm
            Oct 10 '17 at 11:38











          • Ah, OK, I see! I’m mostly curious about the extra packages which deborphan finds. Perhaps they match the auto-removal configuration in /etc/apt/apt.conf.d/01autoremove*...
            – Stephen Kitt
            Oct 10 '17 at 11:43










          • Here's the list, along with the aptitude why of each package: zero.crans.org/…
            – a3nm
            Oct 10 '17 at 11:52


















          up vote
          1
          down vote













          This can be done using the deborphan -n command, or deborphan -an, but paying attention to the fact that this does not seem to really exclude manually installed packages (see here), so they have to be filtered separately. I use:



          comm -3 -1 <(apt-mark showmanual | sort) <(deborphan -na | awk 'print $2' | cut -d':' -f1 | sort)


          See also another solution in a related question.






          share|improve this answer






















            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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f397136%2ffind-which-debian-packages-are-only-installed-because-they-are-recommended-or-su%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            You can also tell apt-get autoremove to ignore “Recommends” and “Suggests”:



            sudo apt-get autoremove -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false


            Use -s to get a list of the removals this would lead to without actually changing anything:



            sudo apt-get autoremove -s -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false





            share|improve this answer




















            • Thanks a lot! I think this is a much better solution than the one I proposed. Somehow, though, this does not return the same set of packages (it mostly returns more, but it also misses a few that deborphan found).
              – a3nm
              Oct 10 '17 at 9:45










            • The difference in output should be explained by your manual selections: deborphan ignores those, so it will find packages you no longer need but that are marked as manually installed. Basically that means you need to periodically review the output of apt-mark showmanual and mark packages you don’t explicitly need as automatically installed; then if they are in practice no longer necessary, autoremove will suggest their removal.
              – Stephen Kitt
              Oct 10 '17 at 11:16










            • Sure, thanks! (In fact, I already have scripts that periodically compare how apt-mark showmanual differs from a list that I maintain separately.) However, my point was that the output of your method is not the same as the output of my method even when I take the output of deborphan and specifically remove the manually installed packages (as per the command that I suggested). So I guess there must be some difference in how these two commands compute their output.
              – a3nm
              Oct 10 '17 at 11:38











            • Ah, OK, I see! I’m mostly curious about the extra packages which deborphan finds. Perhaps they match the auto-removal configuration in /etc/apt/apt.conf.d/01autoremove*...
              – Stephen Kitt
              Oct 10 '17 at 11:43










            • Here's the list, along with the aptitude why of each package: zero.crans.org/…
              – a3nm
              Oct 10 '17 at 11:52















            up vote
            2
            down vote



            accepted










            You can also tell apt-get autoremove to ignore “Recommends” and “Suggests”:



            sudo apt-get autoremove -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false


            Use -s to get a list of the removals this would lead to without actually changing anything:



            sudo apt-get autoremove -s -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false





            share|improve this answer




















            • Thanks a lot! I think this is a much better solution than the one I proposed. Somehow, though, this does not return the same set of packages (it mostly returns more, but it also misses a few that deborphan found).
              – a3nm
              Oct 10 '17 at 9:45










            • The difference in output should be explained by your manual selections: deborphan ignores those, so it will find packages you no longer need but that are marked as manually installed. Basically that means you need to periodically review the output of apt-mark showmanual and mark packages you don’t explicitly need as automatically installed; then if they are in practice no longer necessary, autoremove will suggest their removal.
              – Stephen Kitt
              Oct 10 '17 at 11:16










            • Sure, thanks! (In fact, I already have scripts that periodically compare how apt-mark showmanual differs from a list that I maintain separately.) However, my point was that the output of your method is not the same as the output of my method even when I take the output of deborphan and specifically remove the manually installed packages (as per the command that I suggested). So I guess there must be some difference in how these two commands compute their output.
              – a3nm
              Oct 10 '17 at 11:38











            • Ah, OK, I see! I’m mostly curious about the extra packages which deborphan finds. Perhaps they match the auto-removal configuration in /etc/apt/apt.conf.d/01autoremove*...
              – Stephen Kitt
              Oct 10 '17 at 11:43










            • Here's the list, along with the aptitude why of each package: zero.crans.org/…
              – a3nm
              Oct 10 '17 at 11:52













            up vote
            2
            down vote



            accepted







            up vote
            2
            down vote



            accepted






            You can also tell apt-get autoremove to ignore “Recommends” and “Suggests”:



            sudo apt-get autoremove -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false


            Use -s to get a list of the removals this would lead to without actually changing anything:



            sudo apt-get autoremove -s -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false





            share|improve this answer












            You can also tell apt-get autoremove to ignore “Recommends” and “Suggests”:



            sudo apt-get autoremove -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false


            Use -s to get a list of the removals this would lead to without actually changing anything:



            sudo apt-get autoremove -s -o Apt::AutoRemove::RecommendsImportant=false -o Apt::AutoRemove::SuggestsImportant=false






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 10 '17 at 0:51









            Stephen Kitt

            144k22317382




            144k22317382











            • Thanks a lot! I think this is a much better solution than the one I proposed. Somehow, though, this does not return the same set of packages (it mostly returns more, but it also misses a few that deborphan found).
              – a3nm
              Oct 10 '17 at 9:45










            • The difference in output should be explained by your manual selections: deborphan ignores those, so it will find packages you no longer need but that are marked as manually installed. Basically that means you need to periodically review the output of apt-mark showmanual and mark packages you don’t explicitly need as automatically installed; then if they are in practice no longer necessary, autoremove will suggest their removal.
              – Stephen Kitt
              Oct 10 '17 at 11:16










            • Sure, thanks! (In fact, I already have scripts that periodically compare how apt-mark showmanual differs from a list that I maintain separately.) However, my point was that the output of your method is not the same as the output of my method even when I take the output of deborphan and specifically remove the manually installed packages (as per the command that I suggested). So I guess there must be some difference in how these two commands compute their output.
              – a3nm
              Oct 10 '17 at 11:38











            • Ah, OK, I see! I’m mostly curious about the extra packages which deborphan finds. Perhaps they match the auto-removal configuration in /etc/apt/apt.conf.d/01autoremove*...
              – Stephen Kitt
              Oct 10 '17 at 11:43










            • Here's the list, along with the aptitude why of each package: zero.crans.org/…
              – a3nm
              Oct 10 '17 at 11:52

















            • Thanks a lot! I think this is a much better solution than the one I proposed. Somehow, though, this does not return the same set of packages (it mostly returns more, but it also misses a few that deborphan found).
              – a3nm
              Oct 10 '17 at 9:45










            • The difference in output should be explained by your manual selections: deborphan ignores those, so it will find packages you no longer need but that are marked as manually installed. Basically that means you need to periodically review the output of apt-mark showmanual and mark packages you don’t explicitly need as automatically installed; then if they are in practice no longer necessary, autoremove will suggest their removal.
              – Stephen Kitt
              Oct 10 '17 at 11:16










            • Sure, thanks! (In fact, I already have scripts that periodically compare how apt-mark showmanual differs from a list that I maintain separately.) However, my point was that the output of your method is not the same as the output of my method even when I take the output of deborphan and specifically remove the manually installed packages (as per the command that I suggested). So I guess there must be some difference in how these two commands compute their output.
              – a3nm
              Oct 10 '17 at 11:38











            • Ah, OK, I see! I’m mostly curious about the extra packages which deborphan finds. Perhaps they match the auto-removal configuration in /etc/apt/apt.conf.d/01autoremove*...
              – Stephen Kitt
              Oct 10 '17 at 11:43










            • Here's the list, along with the aptitude why of each package: zero.crans.org/…
              – a3nm
              Oct 10 '17 at 11:52
















            Thanks a lot! I think this is a much better solution than the one I proposed. Somehow, though, this does not return the same set of packages (it mostly returns more, but it also misses a few that deborphan found).
            – a3nm
            Oct 10 '17 at 9:45




            Thanks a lot! I think this is a much better solution than the one I proposed. Somehow, though, this does not return the same set of packages (it mostly returns more, but it also misses a few that deborphan found).
            – a3nm
            Oct 10 '17 at 9:45












            The difference in output should be explained by your manual selections: deborphan ignores those, so it will find packages you no longer need but that are marked as manually installed. Basically that means you need to periodically review the output of apt-mark showmanual and mark packages you don’t explicitly need as automatically installed; then if they are in practice no longer necessary, autoremove will suggest their removal.
            – Stephen Kitt
            Oct 10 '17 at 11:16




            The difference in output should be explained by your manual selections: deborphan ignores those, so it will find packages you no longer need but that are marked as manually installed. Basically that means you need to periodically review the output of apt-mark showmanual and mark packages you don’t explicitly need as automatically installed; then if they are in practice no longer necessary, autoremove will suggest their removal.
            – Stephen Kitt
            Oct 10 '17 at 11:16












            Sure, thanks! (In fact, I already have scripts that periodically compare how apt-mark showmanual differs from a list that I maintain separately.) However, my point was that the output of your method is not the same as the output of my method even when I take the output of deborphan and specifically remove the manually installed packages (as per the command that I suggested). So I guess there must be some difference in how these two commands compute their output.
            – a3nm
            Oct 10 '17 at 11:38





            Sure, thanks! (In fact, I already have scripts that periodically compare how apt-mark showmanual differs from a list that I maintain separately.) However, my point was that the output of your method is not the same as the output of my method even when I take the output of deborphan and specifically remove the manually installed packages (as per the command that I suggested). So I guess there must be some difference in how these two commands compute their output.
            – a3nm
            Oct 10 '17 at 11:38













            Ah, OK, I see! I’m mostly curious about the extra packages which deborphan finds. Perhaps they match the auto-removal configuration in /etc/apt/apt.conf.d/01autoremove*...
            – Stephen Kitt
            Oct 10 '17 at 11:43




            Ah, OK, I see! I’m mostly curious about the extra packages which deborphan finds. Perhaps they match the auto-removal configuration in /etc/apt/apt.conf.d/01autoremove*...
            – Stephen Kitt
            Oct 10 '17 at 11:43












            Here's the list, along with the aptitude why of each package: zero.crans.org/…
            – a3nm
            Oct 10 '17 at 11:52





            Here's the list, along with the aptitude why of each package: zero.crans.org/…
            – a3nm
            Oct 10 '17 at 11:52













            up vote
            1
            down vote













            This can be done using the deborphan -n command, or deborphan -an, but paying attention to the fact that this does not seem to really exclude manually installed packages (see here), so they have to be filtered separately. I use:



            comm -3 -1 <(apt-mark showmanual | sort) <(deborphan -na | awk 'print $2' | cut -d':' -f1 | sort)


            See also another solution in a related question.






            share|improve this answer


























              up vote
              1
              down vote













              This can be done using the deborphan -n command, or deborphan -an, but paying attention to the fact that this does not seem to really exclude manually installed packages (see here), so they have to be filtered separately. I use:



              comm -3 -1 <(apt-mark showmanual | sort) <(deborphan -na | awk 'print $2' | cut -d':' -f1 | sort)


              See also another solution in a related question.






              share|improve this answer
























                up vote
                1
                down vote










                up vote
                1
                down vote









                This can be done using the deborphan -n command, or deborphan -an, but paying attention to the fact that this does not seem to really exclude manually installed packages (see here), so they have to be filtered separately. I use:



                comm -3 -1 <(apt-mark showmanual | sort) <(deborphan -na | awk 'print $2' | cut -d':' -f1 | sort)


                See also another solution in a related question.






                share|improve this answer














                This can be done using the deborphan -n command, or deborphan -an, but paying attention to the fact that this does not seem to really exclude manually installed packages (see here), so they have to be filtered separately. I use:



                comm -3 -1 <(apt-mark showmanual | sort) <(deborphan -na | awk 'print $2' | cut -d':' -f1 | sort)


                See also another solution in a related question.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Oct 9 '17 at 23:52

























                answered Oct 9 '17 at 23:09









                a3nm

                5,13831219




                5,13831219



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397136%2ffind-which-debian-packages-are-only-installed-because-they-are-recommended-or-su%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay