4

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.

Eliah Kagan
  • 117,780
Carlos
  • 131
  • 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
  • I can not see how clean or autoremove would cause the problems you describe. clean - clean clears out the local repository of retrieved package files. . autoremove - autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed. . Neither should break your system. – Panther Nov 28 '14 at 17:14
  • @bodhi.zazen If the OP someone got a dependency messed up I can see autoremove messing things up. For example removing ubuntu-desktop can have unexpected results with autoremove, or so I've heard. I can't remember if I've ever tried it myself. Not extremely likely but possible I'd say. – Seth Nov 29 '14 at 00:12
  • @Seth - I understand your point, but sudo apt-get remove ubuntu-desktop followed by sudo apt-get autoremove does nothing. It is not really autoremove that is the problem here, rather what was removed prior to running autoremove ;) – Panther Nov 29 '14 at 02:21
  • I don't care any more. All I got from this question was a penalty, not an answer. – Carlos Nov 29 '14 at 02:24
  • @bodhi.zazen Essentially, yes, but it would create the effects described in the question (or could anyway). – Seth Nov 29 '14 at 02:48
  • Carlos - It is difficult to really know the source of your problem without additional information. Oli pointed out that sudo apt-get clean really does not cause a problem. autoclean will not either. The source of the problem is likely either 1. some misconfiguration of unity or 2. you removed some essential package PRIOR to running autoremove. Posting information on what you did , as well as the output from those commands, would help. – Panther Nov 29 '14 at 02:53
  • I don't care any more. All I got from this question was a penalty. Some douchebag did not like my question and I got -6 points. – Carlos Nov 29 '14 at 11:28
  • 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 07: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

2 Answers2

13

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™

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Oli
  • 293,335
2

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.

Eliah Kagan
  • 117,780
Alvar
  • 17,058
  • 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