Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
6  
If you're going to ask questions just so you can answer them yourself, could you put a little more effort into the question? –  Roger Pate Aug 27 '10 at 23:48

2 Answers 2

up vote 39 down vote accepted

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 more 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 <command> Ex. man apt-get

share|improve this answer
    
I know in at least aptitude's case, it will autoremove packages automatically. Not that I want to further the which is better to use argument. –  aperson Aug 27 '10 at 9:28
2  
Every command has a manual page and yet I find myself searching the Internet to find out what I need to do - most of the time it is quicker. I am sure you have seen the huge list of command line options that those man pages have - great for usability but sucks for understanding. –  Antony Aug 27 '10 at 10:30
1  
yeah, I always go to the man pages first, but sometimes I find myself googling for some more usable examples. –  Decio Lira Aug 27 '10 at 15:01
    
@aperson thats one advantage of aptitude, but AFAIK apt seems to be getting more attention, maybe they will add that feature sometime. –  Decio Lira Aug 27 '10 at 15:03

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.