What is the Difference Between `apt-get purge` and `apt-get remove`?












180















Is there any difference between



sudo apt-get purge <package-name>


and



sudo apt-get remove <package-name>  


?



I often see people recommend one or the other.



In other words, what does apt-get purge remove that apt-get remove doesn't?










share|improve this question

























  • Related (since apt is similar, but an alternative to, apt-get): askubuntu.com/questions/936810/apt-remove-vs-purge

    – michael
    Sep 19 '18 at 19:21
















180















Is there any difference between



sudo apt-get purge <package-name>


and



sudo apt-get remove <package-name>  


?



I often see people recommend one or the other.



In other words, what does apt-get purge remove that apt-get remove doesn't?










share|improve this question

























  • Related (since apt is similar, but an alternative to, apt-get): askubuntu.com/questions/936810/apt-remove-vs-purge

    – michael
    Sep 19 '18 at 19:21














180












180








180


49






Is there any difference between



sudo apt-get purge <package-name>


and



sudo apt-get remove <package-name>  


?



I often see people recommend one or the other.



In other words, what does apt-get purge remove that apt-get remove doesn't?










share|improve this question
















Is there any difference between



sudo apt-get purge <package-name>


and



sudo apt-get remove <package-name>  


?



I often see people recommend one or the other.



In other words, what does apt-get purge remove that apt-get remove doesn't?







apt uninstall






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 15 '17 at 21:40







Seth

















asked Dec 21 '12 at 23:13









SethSeth

34.3k26110162




34.3k26110162













  • Related (since apt is similar, but an alternative to, apt-get): askubuntu.com/questions/936810/apt-remove-vs-purge

    – michael
    Sep 19 '18 at 19:21



















  • Related (since apt is similar, but an alternative to, apt-get): askubuntu.com/questions/936810/apt-remove-vs-purge

    – michael
    Sep 19 '18 at 19:21

















Related (since apt is similar, but an alternative to, apt-get): askubuntu.com/questions/936810/apt-remove-vs-purge

– michael
Sep 19 '18 at 19:21





Related (since apt is similar, but an alternative to, apt-get): askubuntu.com/questions/936810/apt-remove-vs-purge

– michael
Sep 19 '18 at 19:21










3 Answers
3






active

oldest

votes


















187














As the man apt-get page says:




remove - remove is identical to install except that packages are removed instead of installed. Note that removing a package leaves its configuration files on the system. If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed.



purge - purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).




This of course, does not apply to packages that hold configuration files inside the user's home folder (eg: /home/SexyNoJutsuUser), this files will not be touched ( Why does "Purge" not remove everything related to an app? )



So for example, if you were to remove Chrome, Firefox, XBMC or any other that holds some configuration files inside your /home folder, this files will stay there.



On the other hand if you were to install apache, squid, mysql or any other services similar that save their files in /etc, this configuration files will be deleted if you use purge.






share|improve this answer


























  • Purge can be used on a meta package to remove it, while leaving the underlying package intact. If you want to upgrade the base system without affecting postgres, you can apt-get purge the postgres meta package and then upgrading from Debian 7- Debian 8 will leave your postgres version untouched.

    – boatcoder
    Jul 7 '16 at 14:33



















25














An excerpt from my answer on another question:






  • apt-get remove packagename
    will remove the binaries, but not the configuration or data files of the package packagename.


  • apt-get purge packagename, or
    apt-get remove --purge packagename
    will remove about everything regarding the package
    packagename, [...]
    Particularly useful
    when you want to 'start all over' with an application because you
    messed up the configuration.







share|improve this answer

































    9














    apt-get purge removes configuration files, while apt-get remove does not.






    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',
      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%2faskubuntu.com%2fquestions%2f231562%2fwhat-is-the-difference-between-apt-get-purge-and-apt-get-remove%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      187














      As the man apt-get page says:




      remove - remove is identical to install except that packages are removed instead of installed. Note that removing a package leaves its configuration files on the system. If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed.



      purge - purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).




      This of course, does not apply to packages that hold configuration files inside the user's home folder (eg: /home/SexyNoJutsuUser), this files will not be touched ( Why does "Purge" not remove everything related to an app? )



      So for example, if you were to remove Chrome, Firefox, XBMC or any other that holds some configuration files inside your /home folder, this files will stay there.



      On the other hand if you were to install apache, squid, mysql or any other services similar that save their files in /etc, this configuration files will be deleted if you use purge.






      share|improve this answer


























      • Purge can be used on a meta package to remove it, while leaving the underlying package intact. If you want to upgrade the base system without affecting postgres, you can apt-get purge the postgres meta package and then upgrading from Debian 7- Debian 8 will leave your postgres version untouched.

        – boatcoder
        Jul 7 '16 at 14:33
















      187














      As the man apt-get page says:




      remove - remove is identical to install except that packages are removed instead of installed. Note that removing a package leaves its configuration files on the system. If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed.



      purge - purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).




      This of course, does not apply to packages that hold configuration files inside the user's home folder (eg: /home/SexyNoJutsuUser), this files will not be touched ( Why does "Purge" not remove everything related to an app? )



      So for example, if you were to remove Chrome, Firefox, XBMC or any other that holds some configuration files inside your /home folder, this files will stay there.



      On the other hand if you were to install apache, squid, mysql or any other services similar that save their files in /etc, this configuration files will be deleted if you use purge.






      share|improve this answer


























      • Purge can be used on a meta package to remove it, while leaving the underlying package intact. If you want to upgrade the base system without affecting postgres, you can apt-get purge the postgres meta package and then upgrading from Debian 7- Debian 8 will leave your postgres version untouched.

        – boatcoder
        Jul 7 '16 at 14:33














      187












      187








      187







      As the man apt-get page says:




      remove - remove is identical to install except that packages are removed instead of installed. Note that removing a package leaves its configuration files on the system. If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed.



      purge - purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).




      This of course, does not apply to packages that hold configuration files inside the user's home folder (eg: /home/SexyNoJutsuUser), this files will not be touched ( Why does "Purge" not remove everything related to an app? )



      So for example, if you were to remove Chrome, Firefox, XBMC or any other that holds some configuration files inside your /home folder, this files will stay there.



      On the other hand if you were to install apache, squid, mysql or any other services similar that save their files in /etc, this configuration files will be deleted if you use purge.






      share|improve this answer















      As the man apt-get page says:




      remove - remove is identical to install except that packages are removed instead of installed. Note that removing a package leaves its configuration files on the system. If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed.



      purge - purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).




      This of course, does not apply to packages that hold configuration files inside the user's home folder (eg: /home/SexyNoJutsuUser), this files will not be touched ( Why does "Purge" not remove everything related to an app? )



      So for example, if you were to remove Chrome, Firefox, XBMC or any other that holds some configuration files inside your /home folder, this files will stay there.



      On the other hand if you were to install apache, squid, mysql or any other services similar that save their files in /etc, this configuration files will be deleted if you use purge.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jan 25 at 2:04









      Pablo Bianchi

      2,4851532




      2,4851532










      answered Dec 21 '12 at 23:21









      Luis AlvaradoLuis Alvarado

      145k135485653




      145k135485653













      • Purge can be used on a meta package to remove it, while leaving the underlying package intact. If you want to upgrade the base system without affecting postgres, you can apt-get purge the postgres meta package and then upgrading from Debian 7- Debian 8 will leave your postgres version untouched.

        – boatcoder
        Jul 7 '16 at 14:33



















      • Purge can be used on a meta package to remove it, while leaving the underlying package intact. If you want to upgrade the base system without affecting postgres, you can apt-get purge the postgres meta package and then upgrading from Debian 7- Debian 8 will leave your postgres version untouched.

        – boatcoder
        Jul 7 '16 at 14:33

















      Purge can be used on a meta package to remove it, while leaving the underlying package intact. If you want to upgrade the base system without affecting postgres, you can apt-get purge the postgres meta package and then upgrading from Debian 7- Debian 8 will leave your postgres version untouched.

      – boatcoder
      Jul 7 '16 at 14:33





      Purge can be used on a meta package to remove it, while leaving the underlying package intact. If you want to upgrade the base system without affecting postgres, you can apt-get purge the postgres meta package and then upgrading from Debian 7- Debian 8 will leave your postgres version untouched.

      – boatcoder
      Jul 7 '16 at 14:33













      25














      An excerpt from my answer on another question:






      • apt-get remove packagename
        will remove the binaries, but not the configuration or data files of the package packagename.


      • apt-get purge packagename, or
        apt-get remove --purge packagename
        will remove about everything regarding the package
        packagename, [...]
        Particularly useful
        when you want to 'start all over' with an application because you
        messed up the configuration.







      share|improve this answer






























        25














        An excerpt from my answer on another question:






        • apt-get remove packagename
          will remove the binaries, but not the configuration or data files of the package packagename.


        • apt-get purge packagename, or
          apt-get remove --purge packagename
          will remove about everything regarding the package
          packagename, [...]
          Particularly useful
          when you want to 'start all over' with an application because you
          messed up the configuration.







        share|improve this answer




























          25












          25








          25







          An excerpt from my answer on another question:






          • apt-get remove packagename
            will remove the binaries, but not the configuration or data files of the package packagename.


          • apt-get purge packagename, or
            apt-get remove --purge packagename
            will remove about everything regarding the package
            packagename, [...]
            Particularly useful
            when you want to 'start all over' with an application because you
            messed up the configuration.







          share|improve this answer















          An excerpt from my answer on another question:






          • apt-get remove packagename
            will remove the binaries, but not the configuration or data files of the package packagename.


          • apt-get purge packagename, or
            apt-get remove --purge packagename
            will remove about everything regarding the package
            packagename, [...]
            Particularly useful
            when you want to 'start all over' with an application because you
            messed up the configuration.








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 13 '17 at 12:24









          Community

          1




          1










          answered Dec 21 '12 at 23:18









          gertvdijkgertvdijk

          50.5k18142238




          50.5k18142238























              9














              apt-get purge removes configuration files, while apt-get remove does not.






              share|improve this answer






























                9














                apt-get purge removes configuration files, while apt-get remove does not.






                share|improve this answer




























                  9












                  9








                  9







                  apt-get purge removes configuration files, while apt-get remove does not.






                  share|improve this answer















                  apt-get purge removes configuration files, while apt-get remove does not.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jul 17 '17 at 10:30









                  d a i s y

                  3,32282344




                  3,32282344










                  answered Dec 21 '12 at 23:19









                  moon.musickmoon.musick

                  1,31211320




                  1,31211320






























                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f231562%2fwhat-is-the-difference-between-apt-get-purge-and-apt-get-remove%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

                      How did Captain America manage to do this?

                      迪纳利

                      南乌拉尔铁路局