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.

What, if anything, is the difference between this command:

sudo apt-get clean

And this command:

sudo apt-get clean all

On my Lubuntu 12.04 system, simulating these commands reveals their behavior to be exactly the same:

ek@Apok:~$ apt-get -s clean
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Del /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin
ek@Apok:~$ apt-get -s clean all
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Del /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin
ek@Apok:~$

Is there ever any difference in apt-get's behavior with clean and clean all? If so, what is the difference, under what circumstances is it relevant, and how should I choose between the two? If there is no difference, then why does clean all exist?

If they're the same, then clean all would still make sense if clean could ordinarily take a package name as an argument. But this is not the case--attempting to pass a package name to clean doesn't alter clean's behavior at all, the whole cache still gets deleted:

ek@Apok:~$ apt-get -s clean nano
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Del /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin

This does make me wonder, though, if perhaps clean all doesn't really exist (and that what's happening is that all is ignored, just as nano was in the above example).

Is clean all just an urban legend?

share|improve this question
2  
"Is clean all just an urban legend?" Yes, sir. –  Braiam Jun 5 at 20:11

1 Answer 1

up vote 59 down vote accepted

In

sudo apt-get clean all

all is just ignored, like anything else you append after clean.

It's the same with for example

sudo apt-get clean my room
share|improve this answer
5  
Is (or was) there any documentation that recommended clean all? How did the practice of running sudo apt-get clean all arise? Did the behavior used to be different? Or is running clean all just a confusion, perhaps arising from somewhat similar make syntax? –  Eliah Kagan May 30 '12 at 17:58
    
I've never seen any documentation recommending apt-get clean all. I guess it's a confusion with make or something similar. –  Florian Diesch May 30 '12 at 18:09
1  
When I search for apt-get clean all on Google, there are 48,900 results (though, admittedly, the first two are for this question). On the other hand, the manual page hasn't said anything about it, and I can't find any official sources that recommend using it. I'd like to know more about how this arose...but I suspect that might take considerable time and effort. –  Eliah Kagan May 30 '12 at 18:12
    
A messy room/desk gnawing on your subconscious, @EliahKagan? :P –  izx May 30 '12 at 20:21

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.