4

I want to use apt-get autoremove to remove liba for instance, but I'm not sure whether it is smart enough to preserve other dependencies. For instance, if liba depends on libb, while libc also depends on libb, will

sudo apt-get autoremove liba

remove libb or not? Thanks in advance.

4ae1e1
  • 1,459
  • 1
  • 12
  • 15

4 Answers4

6

None of the apt-get or other APT tools will ever break dependencies (except for bugs).

You don't run apt-get autoremove liba, just apt-get autoremove. The whole point of autoremove is that it discovers what there is to remove.

When you run apt-get autoremove, check the list of packages to make sure you aren't relying on any of the packages that it will remove. A package that you use all the time could have been pulled in as a dependency of another package without you having noticed that.

  • I made a stupid conceptual mistake due to laziness. Thanks. – 4ae1e1 May 11 '13 at 17:19
  • You can run apt-get autoremove liba to remove liba and any other packages which are no longer used and are set to be removed automatically when the autoremove command is run. – dobey May 12 '13 at 00:21
1

The autoremove option to apt-get will only remove the packages which depend on liba and packages which are no longer used.

dobey
  • 40,982
0

If you want to remove liba you should run apt remove liba. Then you can run apt autoremove to remove any other dependencies of liba that is not used anymore.

apt keeps (1) a list of packages that you install and (2) a list of packages that automatically installed because it was dependencies on the packages that you installed. So when you call apt autoremove it checks these lists for packages that (1) you didn't install on your own and (2) also that are not dependencies to other packages anymore.

0

From the apt-get man page:

autoremove is used to remove packages that were automatically installed to satisfy dependencies for some package and that are no more needed.

autoremove doesn't accept any package as argument (the command is just apt-get autoremove). No dependency will be broken.

Eric Carvalho
  • 54,385