For example Atom text editor. When I run:

sudo apt-get install imagemagick # http://www.imagemagick.org/script/index.php


you might want to run 'apt-get -f install' to correct these: 
The following packages have unmet dependencies:  virtualbox-5.0:i386 : Depends: psmisc:i386 but it is not going to be installed

So, then when I try:

sudo apt-get -f install

I get

The following packages were automatically installed and are no longer required:
  libgtkspell0 pidgin-data
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
The following packages will be REMOVED:
  atom gconf2 psmisc
The following NEW packages will be installed:

My question is: why should Atom be uninstalled when I try to install something completely different?

EDIT: repeting the procedure but with

apt-get autoremove

instead of

sudo apt-get -f install

solved the issue.

But I still don't get why an unneeded package should trigger the removal of a package that I actually need (atom)


that happens because each package in apt has a list of dependencies, which you can see with:

apt-cache depends libgtkspell0 pidgin-data atom

In order to retain the packages apt is suggesting you remove, atom, which has a dependency that conflicts with one of the dependencies atom has. Note in particular the:

Conflicts: libgtkspell0:i386

part of the output.

So apt is simply trying to resolve a conflict. One could note that it might almost be worth posting an issue to the packager of the two to be removed packages because in theory apt should offer to remove the package no longer needed, not a package that is active in the system, but it's always a balance creating and maintaining dependency/conflict lists in a package pool.

If I were to guess, I'd guess apt internally doesn't really have a way to differentiate between to be remove and active packages when creating its dependency lists, so it's simply picking the outcome with the fewest negative (ie, forced removal of a package) outcome.

  • thank you for your explanation. However, how do you explain that "apt-get autoremove" solves the issues without creating others? – dragonmnl Nov 7 '15 at 19:27
  • Because autoremove removes a group of packages which created the dependency conflict in this case with atom. Since apt had to decide between the package that had the dependency and atom, once you have removed the non necessary package, atom no longer is subject to that internal dependency conflict. Autoremove won't create any issues because it by definition only removes packages that were automatically pulled in by other packages but which are no longer required either because they were replaced by something else or because the other package was removed. – Lizardx Nov 7 '15 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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