How to completely remove a package in Ubuntu (like it never existed)












6















When I remove a package in Ubuntu using apt-get remove package, it always seems to leave behind a lot of files... for example, log files in /var/log, config files in /etc, data in /var/lib, etc.



How do I COMPLETELY remove every trace of a package in Ubuntu, as if it never existed?










share|improve this question



























    6















    When I remove a package in Ubuntu using apt-get remove package, it always seems to leave behind a lot of files... for example, log files in /var/log, config files in /etc, data in /var/lib, etc.



    How do I COMPLETELY remove every trace of a package in Ubuntu, as if it never existed?










    share|improve this question

























      6












      6








      6








      When I remove a package in Ubuntu using apt-get remove package, it always seems to leave behind a lot of files... for example, log files in /var/log, config files in /etc, data in /var/lib, etc.



      How do I COMPLETELY remove every trace of a package in Ubuntu, as if it never existed?










      share|improve this question














      When I remove a package in Ubuntu using apt-get remove package, it always seems to leave behind a lot of files... for example, log files in /var/log, config files in /etc, data in /var/lib, etc.



      How do I COMPLETELY remove every trace of a package in Ubuntu, as if it never existed?







      linux ubuntu apt package-management packages






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 25 at 11:25









      torjinxtorjinx

      1406




      1406






















          1 Answer
          1






          active

          oldest

          votes


















          10














          You should purge those packages.



          apt-get purge somepackage


          from man apt-get (APT-GET(8))



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


          This is supposed to remove everything added by the package, such as config and data files. But I would assume it's possible that it generated something that is left behind anyway. dpkg doesn't track everything related to a package... and its cleanup scripts and such can be assumed to be imperfect and sometimes fail. Maybe it won't remove logs for example.






          share|improve this answer



















          • 1





            It should be noted that even purge does not remove e.g. config files in ~/.local, see this answer over on askubuntu for a deeper dive.

            – Jared Smith
            Feb 25 at 14:10






          • 5





            purge will not remove files which were generated by the application, as opposed to the ones installed by apt. This includes the files generated indirectly, such as logs (which come from the app sending logging events to /dev/log, which is then parsed by another utility (rsyslog, ...)

            – WoJ
            Feb 25 at 17:40













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          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%2fserverfault.com%2fquestions%2f955616%2fhow-to-completely-remove-a-package-in-ubuntu-like-it-never-existed%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          10














          You should purge those packages.



          apt-get purge somepackage


          from man apt-get (APT-GET(8))



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


          This is supposed to remove everything added by the package, such as config and data files. But I would assume it's possible that it generated something that is left behind anyway. dpkg doesn't track everything related to a package... and its cleanup scripts and such can be assumed to be imperfect and sometimes fail. Maybe it won't remove logs for example.






          share|improve this answer



















          • 1





            It should be noted that even purge does not remove e.g. config files in ~/.local, see this answer over on askubuntu for a deeper dive.

            – Jared Smith
            Feb 25 at 14:10






          • 5





            purge will not remove files which were generated by the application, as opposed to the ones installed by apt. This includes the files generated indirectly, such as logs (which come from the app sending logging events to /dev/log, which is then parsed by another utility (rsyslog, ...)

            – WoJ
            Feb 25 at 17:40


















          10














          You should purge those packages.



          apt-get purge somepackage


          from man apt-get (APT-GET(8))



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


          This is supposed to remove everything added by the package, such as config and data files. But I would assume it's possible that it generated something that is left behind anyway. dpkg doesn't track everything related to a package... and its cleanup scripts and such can be assumed to be imperfect and sometimes fail. Maybe it won't remove logs for example.






          share|improve this answer



















          • 1





            It should be noted that even purge does not remove e.g. config files in ~/.local, see this answer over on askubuntu for a deeper dive.

            – Jared Smith
            Feb 25 at 14:10






          • 5





            purge will not remove files which were generated by the application, as opposed to the ones installed by apt. This includes the files generated indirectly, such as logs (which come from the app sending logging events to /dev/log, which is then parsed by another utility (rsyslog, ...)

            – WoJ
            Feb 25 at 17:40
















          10












          10








          10







          You should purge those packages.



          apt-get purge somepackage


          from man apt-get (APT-GET(8))



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


          This is supposed to remove everything added by the package, such as config and data files. But I would assume it's possible that it generated something that is left behind anyway. dpkg doesn't track everything related to a package... and its cleanup scripts and such can be assumed to be imperfect and sometimes fail. Maybe it won't remove logs for example.






          share|improve this answer













          You should purge those packages.



          apt-get purge somepackage


          from man apt-get (APT-GET(8))



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


          This is supposed to remove everything added by the package, such as config and data files. But I would assume it's possible that it generated something that is left behind anyway. dpkg doesn't track everything related to a package... and its cleanup scripts and such can be assumed to be imperfect and sometimes fail. Maybe it won't remove logs for example.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 25 at 11:40









          PeterPeter

          1,87611121




          1,87611121








          • 1





            It should be noted that even purge does not remove e.g. config files in ~/.local, see this answer over on askubuntu for a deeper dive.

            – Jared Smith
            Feb 25 at 14:10






          • 5





            purge will not remove files which were generated by the application, as opposed to the ones installed by apt. This includes the files generated indirectly, such as logs (which come from the app sending logging events to /dev/log, which is then parsed by another utility (rsyslog, ...)

            – WoJ
            Feb 25 at 17:40
















          • 1





            It should be noted that even purge does not remove e.g. config files in ~/.local, see this answer over on askubuntu for a deeper dive.

            – Jared Smith
            Feb 25 at 14:10






          • 5





            purge will not remove files which were generated by the application, as opposed to the ones installed by apt. This includes the files generated indirectly, such as logs (which come from the app sending logging events to /dev/log, which is then parsed by another utility (rsyslog, ...)

            – WoJ
            Feb 25 at 17:40










          1




          1





          It should be noted that even purge does not remove e.g. config files in ~/.local, see this answer over on askubuntu for a deeper dive.

          – Jared Smith
          Feb 25 at 14:10





          It should be noted that even purge does not remove e.g. config files in ~/.local, see this answer over on askubuntu for a deeper dive.

          – Jared Smith
          Feb 25 at 14:10




          5




          5





          purge will not remove files which were generated by the application, as opposed to the ones installed by apt. This includes the files generated indirectly, such as logs (which come from the app sending logging events to /dev/log, which is then parsed by another utility (rsyslog, ...)

          – WoJ
          Feb 25 at 17:40







          purge will not remove files which were generated by the application, as opposed to the ones installed by apt. This includes the files generated indirectly, such as logs (which come from the app sending logging events to /dev/log, which is then parsed by another utility (rsyslog, ...)

          – WoJ
          Feb 25 at 17:40




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Server Fault!


          • 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%2fserverfault.com%2fquestions%2f955616%2fhow-to-completely-remove-a-package-in-ubuntu-like-it-never-existed%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

          Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

          ComboBox Display Member on multiple fields

          Is it possible to collect Nectar points via Trainline?