What is difference between the options "autoclean", "autoremove" and "clean"?

apt-get has a few options which looks the same to me: autoclean, autoremove and clean. What do each of them do?

Asked By: Antony

||

autoclean: removes all stored archives in your cache for packages that can not be downloaded anymore (thus packages that are no longer in the repo or that have a newer version in the repo).

clean: removes all stored archives in your cache.

autoremove: a whole different thing, this option makes apt look for packages that are installed as dependency of an already uninstalled package and removes them. This is used to clean up unused dependencies that remain on your system.

Answer found: http://ubuntuforums.org/showthread.php?t=394952

Answered By: Antony

From the apt-get man page:

  • clean: clean clears out the local repository of retrieved package files.
    It removes everything but the lock file from
    /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. When
    APT is used as a dselect(1) method, clean is run automatically.
    Those who do not use dselect will likely want to run apt-get clean
    from time to time to free up disk space.

  • autoclean: Like clean, autoclean clears out the local repository of retrieved
    package files. The difference is that it only removes package files
    that can no longer be downloaded, and are largely useless. This
    allows a cache to be maintained over a long period without it
    growing out of control. The configuration option
    APT::Clean-Installed will prevent installed packages from being
    erased if it is set to off.

  • autoremove: is used to remove packages that were automatically
    installed to satisfy dependencies for some package and that are no
    longer needed.

Every command has a manual page, if you want to know what their parameters are or what each of them do, just type in the shell `man ` Ex. `man apt-get`

Answered By: Decio Lira
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.