How do I get a list of packages (and their versions) managed by DKMS so I can easily add/remove them?
2 Answers
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.

- 369,824
-
1You sure have a lot of kernel versions. – BatchyX Apr 20 '13 at 16:59
-
1That's Ubuntu. I do literally no maintenance on it, just apply updates occasionally. Not my main system, it's my wife's. – slm Apr 20 '13 at 17:02
-
@slm See http://askubuntu.com/q/89710/6969 on how to easily remove old kernels. – Lekensteyn Apr 20 '13 at 17:23
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.

- 2,699