What is the difference between sudo apt-get purge
and sudo apt get remove --purge
?
There must be a difference or both of them shouldn't exist.
What is the difference between sudo apt-get purge
and sudo apt get remove --purge
?
There must be a difference or both of them shouldn't exist.
Whether they should or shouldn't both exist is perhaps a debating point.
However - they are absolutely identical.
From the man page of
apt-get
They key part is --purge is equivalent to the purge command
As to why - I would surmise this is historical -
apt-get --purge remove
came beforeapt-get purge
Looking at the old apt documentation it make reference to the older version of the command. The newer documentation gives the
aptitude
&apt-get purge
example.For the sake of consistency - its a good idea to not remove old interfaces - if you have an old script - it will still work today because the interface commands still exist.
Mind you that doesnt stop Gnome from deprecating api's - but that's another story...
There isn't one as far as I know, they do the same thing exactly, remove packages and try to remove any configuration files created by those packages.
Basically
apt-get purge
was implemented afterapt-get remove --purge
but the old option styled purge still remained.They are the same, as it says in the official man page:
remove --purge is equivalent to the purge command.
Seeman apt
and the Ubuntu manpages online. I think the usage developed and both commands remained; as happens in other programs, usage changes and one form (i.e.sudo apt-get purge
) becomes preferred over the other. However, I am still looking for a reference for this and researching the history of the usage, although there are useful chapters on package management in the Debian Handbook and articles on apt-get at Raphael Hertzog's blog.Using the example of removing vlc (albeit with the
-s
simulate flag), we can see that the commands have identical results; all the other files used by vlc need to be removed withsudo apt-get autoremove
in both cases.1)
sudo apt-get remove --purge
2)
sudo apt-get purge
As previous answers have stated, the two are indeed equivalent.
One valid reason does come to mind for the continued existence of both forms, however:
apt-get purge
is a useful, later-added shorthand for the complete removal of specific packages--purge
flag allows modification of other apt-get calls to purge configuration files as well, as inapt-get autoremove --purge
As a regular experimenter with new software, I myself have had considerably less old configuration files floating around since learning how to modify autoremove calls!