I'd like to list all the packages that uses a given file. I'm willing to use any tool (such as dpkg, dlocate, apt-file etc.), Please do mind when I say 'use' I don't mean necessarily only owns/installs the file, I'd like to know which package also reference it, link against it etc.
here's my use case:
I have installed both KVM and VirtualBox and ended up using only VirtualBox, as it turns out VirtualBox and KVM competes for resources of some sort, fortunately enough for me I don't use KVM so I just uninstalled it.
sudo apt-get purge kvm
But it wasn't enough and when I tried to run VirtualBox on a subsequent boot I got the following error:
Error: failed to start machine. Error message: VirtualBox can't operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_VMX_IN_VMX_ROOT_MODE)
looking at the loaded modules revealed that the kvm kernel modules were still loaded
mcradle:~> lsmod | grep -i kvm kvm_intel 39416 0 kvm 244969 1 kvm_intel
tuned to a web search which suggested to purge qemu-kvm
sudo apt-get purge qemu-kvm
this did the trick, now my question is: how could I have gotten to this conclusion systematically without the web-magic-dust? In particular It would be nice to know how can one tell which package depends on a given file?
Please do mind that dlocate -S is not good enough because it shows the file's owner package and I wanted to find the package that causes 'kvm.ko' to be loaded!
mcradle:/etc# dlocate -S kvm.ko linux-image-2.6.32-25-generic-pae: /lib/modules/2.6.32-25-generic-pae/kernel/arch/x86/kvm/kvm.ko
if 'apt-rdepends -r' would have accepted files instead of packages that could have been exactly what I'm after.
Thanks in advance and I hope the question is clear.