Friday, December 30, 2016

What is the difference between `apt-get purge` and `apt-get remove`?


Someone just asked me via email, what is the difference between 'apt-get purge' and 'apt-get remove' command on ubuntu? Both commands are for uninstalling/removing software packages in ubuntu world.

Both commands (apt-get purge and remove) are for the same purpose, but is there any different between this two commands? Apparently yes, there is a different.

The different is 'apt-get purge' not only uninstalling the software package but also delete any configuration files that comes with the software, while 'apt-get remove' only uninstall the software and leave any configuration intact.  

Note that even though 'apt-get purge' can delete configuration files, but it will not delete any configuration files inside your home directory, any config files inside home directory will not be touch.
remove :
Packages installed are removed (Does NOT include configuration files)
purge :
Purge is identical to remove except that packages are removed and purged. Purge meaning that any configuration files are deleted too.
So there you have it, that's the difference between 'apt-get remove' and 'apt-get purge', also worth mentioning that sometimes when you uninstall a package, you still need to run additional command which is 'apt-get autoremove'.


No comments:

Post a Comment