Correct use of apt-get remove/purge/autoremove

Florian Diesch diesch at spamfence.net
Wed Mar 16 08:56:03 UTC 2011


 Am Mittwoch, den 16.03.2011, 09:18 +0100 schrieb Niki Kovacs 
 <contact at kikinovak.net>:
> Hi,
>
> I'm currently trying to get a firmer grasp on package management.
>
> 1) 'apt-get remove' removes a package or a series of packages, but
> leaves configuration files untouched. Plus, eventual dependencies are
> also left on the system.
>
> 2) 'apt-get purge' removes a package or a series of packages, as well
> as their respective configuration files. Eventual dependencies are
> left on the system.
>
> 3) 'apt-get autoremove' removes a package as well as all the
> dependencies that are only needed by this single package. On the 
> other
> hand, configuration files are left on the system.

 No, 'autoremove' removes all package that got automatically installed 
 to satisfy
 dependencies, not just the ones for the given package.

> It would seem logical to me to combine these, two, e. g. if I have
> apache2 on a system and decide I don't want a web server anymore, to
> 'autoremove' the apache2 package (which comes with a bunch of
> dependencies) as well as purge the whole cruft of configuration 
> files.
> But what would be the orthodox way of doing so?

 The --purge option makes apt-get to remove config files.

 So 'apt-get purge' is the same as 'apt-get --purge remove' and
 'apt-get --purge autoremove' is the "autopurge" you want.


-- 
 <http://www.florian-diesch.de>
 <http://identi.ca/diesch/>




More information about the ubuntu-users mailing list