Mark all autoremovable packages as manually-installed in one command

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











up vote
1
down vote

favorite












I have many packages that are marked as autoremovable. I want to mark them as manually-installed, so that they are no longer autoremovable.



I can do it one package at-a-time using



sudo apt-mark manual <package name>


But how can I do it for all of the packages in one go, without typing all of the package names.



An answer to this question describes how to mark all automatically-installed packages as manually-installed, but I want to mark only the autoremovable packages.







share|improve this question

























    up vote
    1
    down vote

    favorite












    I have many packages that are marked as autoremovable. I want to mark them as manually-installed, so that they are no longer autoremovable.



    I can do it one package at-a-time using



    sudo apt-mark manual <package name>


    But how can I do it for all of the packages in one go, without typing all of the package names.



    An answer to this question describes how to mark all automatically-installed packages as manually-installed, but I want to mark only the autoremovable packages.







    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have many packages that are marked as autoremovable. I want to mark them as manually-installed, so that they are no longer autoremovable.



      I can do it one package at-a-time using



      sudo apt-mark manual <package name>


      But how can I do it for all of the packages in one go, without typing all of the package names.



      An answer to this question describes how to mark all automatically-installed packages as manually-installed, but I want to mark only the autoremovable packages.







      share|improve this question













      I have many packages that are marked as autoremovable. I want to mark them as manually-installed, so that they are no longer autoremovable.



      I can do it one package at-a-time using



      sudo apt-mark manual <package name>


      But how can I do it for all of the packages in one go, without typing all of the package names.



      An answer to this question describes how to mark all automatically-installed packages as manually-installed, but I want to mark only the autoremovable packages.









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jun 7 at 13:29
























      asked Jun 7 at 13:15









      EmmaV

      9691028




      9691028




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          You can specify multiple package names as arguments to apt-mark manual:



          sudo apt-mark manual package1 package2 package3


          This will mark all those packages as manually installed.



          Thus



          sudo apt-mark manual $(sudo apt-get -s autoremove 2>/dev/null | awk '/^Remv / print $2 ')


          will mark all packages which are auto-removable as manually installed.






          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%2f448420%2fmark-all-autoremovable-packages-as-manually-installed-in-one-command%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote



            accepted










            You can specify multiple package names as arguments to apt-mark manual:



            sudo apt-mark manual package1 package2 package3


            This will mark all those packages as manually installed.



            Thus



            sudo apt-mark manual $(sudo apt-get -s autoremove 2>/dev/null | awk '/^Remv / print $2 ')


            will mark all packages which are auto-removable as manually installed.






            share|improve this answer



























              up vote
              3
              down vote



              accepted










              You can specify multiple package names as arguments to apt-mark manual:



              sudo apt-mark manual package1 package2 package3


              This will mark all those packages as manually installed.



              Thus



              sudo apt-mark manual $(sudo apt-get -s autoremove 2>/dev/null | awk '/^Remv / print $2 ')


              will mark all packages which are auto-removable as manually installed.






              share|improve this answer

























                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                You can specify multiple package names as arguments to apt-mark manual:



                sudo apt-mark manual package1 package2 package3


                This will mark all those packages as manually installed.



                Thus



                sudo apt-mark manual $(sudo apt-get -s autoremove 2>/dev/null | awk '/^Remv / print $2 ')


                will mark all packages which are auto-removable as manually installed.






                share|improve this answer















                You can specify multiple package names as arguments to apt-mark manual:



                sudo apt-mark manual package1 package2 package3


                This will mark all those packages as manually installed.



                Thus



                sudo apt-mark manual $(sudo apt-get -s autoremove 2>/dev/null | awk '/^Remv / print $2 ')


                will mark all packages which are auto-removable as manually installed.







                share|improve this answer















                share|improve this answer



                share|improve this answer








                edited Jun 7 at 13:23


























                answered Jun 7 at 13:18









                Stephen Kitt

                139k22301363




                139k22301363






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448420%2fmark-all-autoremovable-packages-as-manually-installed-in-one-command%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)