During a recent apt-get dist-upgrade
of 12.10 I received the following error:
Setting up linux-headers-3.5.0-19-generic (3.5.0-19.30) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 3.5.0-19-generic /boot/vmlinuz-3.5.0-19-generic
Error! Could not locate dkms.conf file.
File: does not exist.
Any ideas?
This is usually caused by modules in
/var/lib/dkms
that don't have adkms.conf
file within their source subdirectories -dkms
expects this file, so will report an error if it's missing, and then may miss out on compiling some valid modules.To find the offending module, run this short script (thanks to Lekensteyn):
That will output any dkms module directories; you can then decide whether to uninstall the package that created them, or if they've been manually installed or renamed, to move them somewhere else or remove them.
I've been getting that on kernel upgrades for a while, with the result that not all of my
dkms
drivers get updated on kernel-upgrades.Firstly I was able to workaround the problem by reconfiguring any packages that used
dkms
to force them to be recompiled for the current kernel - eg it was my AMD video drivers that failed (package ==fglrx
):That would at least get the drivers configured for the current version.
Finally I found this bug, which includes some steps you can use to diagnose: https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/830915
Basically what they're doing is looking around for anything that is surprising, or unexpected - eg packages you have uninstalled - or software you have manually installed on an earlier ubuntu version and may not work with the newer version. Particularly check the date-stamp on the directories which might show you particularly old packages could be from manually installed packages.
In my case I had an old version of the
fglrx
install I had used to diagnose some problems a year ago and had simply re-named it. Deleting this old cruft made the problem go away.If there's junk delete it (or move it out of that directory) - if there's a manually installed package there, consider updating it, or uninstalling it and using the maintained version.
I have had this problem with VirtualBox from Oracle's ppa, rather than the one packaged with 12.04 LTS :
I copied the contents of /var/lib/dkms to another directory as a backup, then removed the vboxhost directory in /var/lib/dkms;
I then reconfigured the virtualbox package like this:
and it succeeded in doing this:
I was also suffering from this problem for a long time. I need to reinstall the NVIDIA driver each time after kernel update and restart. Recently, I started to look into this problem. Actually, my problem is that there are multiple module folders with the same prefix
nvidia-
under/usr/src/
and multiple folders with different version numbers under/var/lib/dkms/nvidia
. After removing the older versions, both following commandsworked.
This happened to me once on a Red Hat 7.5 Workstation with an Nvidia driver. I know it's not Ubuntu but this may help someone...
Remove the Nvidia files from dkms and then reinstall dkms:
Then reinstall the Nvidia driver
WARNING, this worked for me but may not be the correct way of doing things.