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
  • 119,640
Carlos
  • 131

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,890
  • 56
  • 97
  • 151
Oli
  • 299,380
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
  • 119,640
Alvar
  • 17,038