2

Suppose we sudo apt-get purge mypackage. If mypackage, which is a dependency of yourpackage, is installed at the time that we purge mypackage, is mypackage also removed?

2 Answers 2

2

A simple test will answers you:

$ apt-cache depends vim
vim
  Depends: vim-common
  Depends: vim-runtime
  Depends: libacl1
  Depends: libc6
      ......

Now as you can see the package vim depends on vim-common. So let's try remove the package vim-common:

$ sudo apt-get remove vim-common 
Reading package lists... Done
Building dependency tree    
Reading state information... Done
The following packages will be REMOVED:
  ubuntu-minimal vim vim-common vim-tiny
0 upgraded, 0 newly installed, 4 to remove and 2 not upgraded.
After this operation, 3,268 kB disk space will be freed.
Do you want to continue [Y/n]? 

Take a look on the line:

The following packages will be REMOVED:
   ubuntu-minimal vim vim-common vim-tiny

So as a conclusion removing a package will cause to remove all packages that depend on it.

2
  • Yes , but apt-get remove vim will not remove vim-common. Do apt-get autoremove after you deinstall, it will remove unneeded packages. Purge removes the configuration of packages.
    – Uwe Burger
    Jul 22, 2015 at 17:52
  • @UweBurger Please read the question again, the OP asks for reverse dependencies
    – Maythux
    Jul 23, 2015 at 5:21
0

It is good to check with --dry-run what will happen to prevent accidental damage.

apt purge vim-common --dry-run

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .