19

How do I get a list of packages (and their versions) managed by DKMS so I can easily add/remove them?

Clinton
  • 729

2 Answers2

18

I believe the command you're looking for is dkms status. for example:

% dkms status
virtualbox, 4.1.18: added

On another system that has a lot more DKMS modules installed:

% dkms status
fglrx, 8.960, 3.2.0-33-generic-pae, i686: installed
fglrx, 8.960, 3.2.0-34-generic, i686: installed
fglrx, 8.960, 3.2.0-34-generic-pae, i686: installed
fglrx, 8.960, 3.2.0-35-generic, i686: installed
fglrx, 8.960, 3.2.0-35-generic-pae, i686: installed
fglrx, 8.960, 3.2.0-36-generic, i686: installed
fglrx, 8.960, 3.2.0-36-generic-pae, i686: installed
fglrx, 8.960, 3.2.0-37-generic, i686: installed
fglrx, 8.960, 3.2.0-37-generic-pae, i686: installed
fglrx, 8.960, 3.2.0-38-generic, i686: installed
fglrx, 8.960, 3.2.0-38-generic-pae, i686: installed
fglrx, 8.960, 3.2.0-39-generic, i686: installed
fglrx, 8.960, 3.2.0-39-generic-pae, i686: installed
fglrx, 8.960, 3.2.0-40-generic, i686: installed
fglrx, 8.960, 3.2.0-40-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-24-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-24-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-26-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-26-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-27-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-27-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-29-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-29-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-31-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-31-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-32-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-32-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-33-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-33-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-34-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-34-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-35-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-35-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-36-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-36-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-37-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-37-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-38-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-38-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-39-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-39-generic-pae, i686: installed
vboxhost, 4.1.8, 3.2.0-40-generic, i686: installed
vboxhost, 4.1.8, 3.2.0-40-generic-pae, i686: installed

More info on DKMS is here in it's man page.

slm
  • 369,824
6

Being pedantic, dkms status does not show you which packages contain the modules mentioned in the output, if package in that context refers to package management.

The easiest way to verify that would be to check which package contains the respective /usr/src/<modulename>-<moduleversion>/dkms.conf files (for normal modules) or the respective /var/lib/dkms-binary/<modulename>-<moduleversion>/*dkms.conf files (for binary-only dkms modules - although I'm not sure where *buntu or other Debian-based distros put binary-only dkms modules by default, so you might need to verify that path on your distro).

For completeness sake, for an rpm-based distro which has mlocate/slocate this could be easily queried via e.g. rpm -qf $(locate dkms.conf) as that is the easiest way to get the location of all dkms.conf files without knowing where they might be located for that particular distro.

For *buntu or other Debian-based distro it should work the same way,
e.g. dpkg --search $(locate dkms.conf) should achieve the same result and show you the packages that installed the dkms modules listed in dkms status output.

doktor5000
  • 2,699