Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
I know this is a bad answer, but I always have that error, and things work fine. I guess dkms just uses default settings. –  MiJyn Dec 9 '12 at 20:28

2 Answers 2

up vote 13 down vote accepted

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):

sudo dpkg-reconfigure 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

dkms status
ls -R /var/lib/dkms

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.

ls -l /var/lib/dkms

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.

share|improve this answer

I have had this problem with VirtualBox from Oracle's ppa, rather than the one packaged with 12.04 LTS :

Error! Could not locate dkms.conf file.
File:  does not exist.

I copied the contents of /var/lib/dkms to another directory as a backup, then removed the vboxhost directory in /var/lib/dkms;

mkdir ~/backup_dkms
cp -r /var/lib/dkms/* ~/backup_dkms 
rm -rf /var/lib/dkms/vboxhost

I then reconfigured the virtualbox package like this:

sudo dpkg-reconfigure virtualbox-4.2

and it succeeded in doing this:

   * Trying to register the VirtualBox kernel modules using DKMS
share|improve this answer
Just sudo dpkg-reconfigure virtualbox-4.2 did the job. Thank you –  Sergey Jan 6 '14 at 6:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.