This question already has an answer here:

I found somewhere here in the forum that I could use the commands sudo apt-get clean and sudo apt-get autoremove to get rid of things I don´t use and my laptop does not need.

Why is it that every time I use either of these commands Ubuntu starts acting up?

By "acting up" I mean that:

  1. All hot corner functions and Window Snapping functions on my desktop stop working. After entering either of the two commands, the corners I selected as Window Spread will not do/show anything.
  2. The Unity icon on the launcher disappears.

In the end I solved things by reinstalling Ubuntu, Spotify, Skype, Chrome and so on... I don´t really mind. It is only an hour of my time, it is fun and I always learn something.

share|improve this question

marked as duplicate by Zanna, Charles Green, edwinksl, Yaron, Kevin Bowen Sep 3 '17 at 20:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Hard to say without more information. Those commands should not cause a problem, but we would need to command and list of packages removed.We also need to know what you mean by "Ubuntu starts acting up". certainly could be completely unrelated. Last, if you do not know what a package is or does, don't remove it. – Panther Nov 28 '14 at 16:02
    
By acting up I mean that: (1)All Hotcorner functions and Window Snapping functions on my desktop stop working. After entering either of the 2 commands, the corners I selected as Window Spread will not do/show anything. (2)The Unity icon on the Launcher disappears. – Carlos Nov 28 '14 at 16:19
1  
gives a printscreen or a copy of the commands with the output, and then explain exactly each problem that occur. – Alvar Nov 28 '14 at 16:24
2  
As far as I can tell there is only one likely explanation for this, which Oli has provided, with excellent explanation, in his answer, which the OP accepted and the community has upvoted quite a bit. This question was unclear originally because it didn't contain an explanation of what broke, but the OP provided that in comments, and I've added it to the question. This adds even further credence to the explanation that important packages were uninstalled (if you remove packages that provide parts of Unity, UI elements can go missing). I suggest we reopen. – Eliah Kagan Aug 18 '17 at 7:58
1  
@Carlos you probably didn't get a penalty because of your question it self, but for not providing required / requested information ... – Soren A Aug 27 '17 at 17:43
up vote 13 down vote accepted

apt-get clean just removes the package cache. There's no way* it could hurt anything.

apt-get autoremove removes packages that were automatically installed but now their dependent package has either been removed or no longer depends on them. If you remove a package that depends on things (eg ubuntu-desktop) and then do an autoremove, you're going to end up removing a lot of packages.

This is often done by removing something that a big metapackage depends on. If you look at apt-cache depends ubuntu-desktop you'll see a number of Depends: ... packages. If any of these are removed, Apt has to also remove the ubuntu-desktop package. That's dependency resolution in action. If you then run an autoremove, it'll clean up all those other depends (assuming nothing else depends on them).

Occasionally you might end up in a situation where you want to install something but it conflicts with something ubuntu-desktop depends on. Apt may try to force this through by removing the conflict package (and therefore also ubuntu-desktop). It will warn you about this.

The simple fix is to find out which meta-package you're missing, and reinstall it. This is usually ubuntu-desktop. And in the future READ what apt-get tells you. I don't mean that in a nasty way. I wish I did more often. Upgrading to 14.04 I tanked my whole system back to a very basic command line and had to redownload and install over a gig of packages.

* Life, uh… finds a way™

share|improve this answer
2  
Now with more Jeff Goldblum! – David Foerster Aug 18 '17 at 9:11

There's a simple solution to this, stop using the commands that break your system. autoremove and clean shouldn't break the system but if they do, stop using them.

You wont save much disk space anyway, if you have problems with high disk usage, try removing some applications instead.

share|improve this answer
    
You are right, @Alvar... I should not be using something that hurts me... I will be an Ubuntu Software Centre user from now on. – Carlos Nov 28 '14 at 16:55
    
@CarlosC well a good rule to have is to only enter commands that you know exactly what they do, then when something goes wrong, you can fix it. :) – Alvar Nov 28 '14 at 16:59
    
I did not know I could reverse the commands written on the Terminal... (so many things I need to learn here...) From now on I will stick to Ubuntu Software Centre. – Carlos Nov 28 '14 at 18:21

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