Monday, 9 January 2017

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'.

Anonymous

Author & Editor

A technology enthusiast and addictive blogger who likes to hacking tricks and wish to be the best White Hacket Hacker of the World.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.