Error during kernel upgrade: Could not locate dkms.conf file

Bug #830915 reported by Dmitry Tantsur on 2011-08-22
This bug affects 71 people
Affects Status Importance Assigned to Milestone
dkms (Ubuntu)

Bug Description

Настраивается пакет linux-image-3.0.0-9-generic (3.0.0-9.12) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 3.0.0-9-generic /boot/vmlinuz-3.0.0-9-generic
Error! Could not locate dkms.conf file.
File: does not exist.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.0.0-9-generic /boot/vmlinuz-3.0.0-9-generic
update-initramfs: Generating /boot/initrd.img-3.0.0-9-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.0.0-9-generic /boot/vmlinuz-3.0.0-9-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.0.0-9-generic /boot/vmlinuz-3.0.0-9-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.0.0-9-generic /boot/vmlinuz-3.0.0-9-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.0.0-9-generic
Found initrd image: /boot/initrd.img-3.0.0-9-generic
Found linux image: /boot/vmlinuz-3.0.0-8-generic
Found initrd image: /boot/initrd.img-3.0.0-8-generic
Found linux image: /boot/vmlinuz-2.6.38-10-generic
Found initrd image: /boot/initrd.img-2.6.38-10-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Ubuntu Natty (development branch) (11.04) on /dev/sdb5

This, however, doesn't seem to be fatal.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: dkms
ProcVersionSignature: Ubuntu 3.0.0-8.11-generic 3.0.1
Uname: Linux 3.0.0-8-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Mon Aug 22 12:43:31 2011
InstallationMedia: Xubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101008.1)
PackageArchitecture: all
 PATH=(custom, no user)
SourcePackage: dkms
UpgradeStatus: Upgraded to oneiric on 2011-08-10 (11 days ago)

Dmitry Tantsur (divius) wrote :
Changed in dkms (Ubuntu):
status: New → Confirmed
Vicenç Juan Tomàs (vtomasr5) wrote :

The same happens to me with linux-image-3.0.0-11-generic version.

Compizfox (compizfox) wrote :

Got the same error when installing the kernel headers for 3.0.0-12.

chrysoberyl (lnxme1) wrote :

Got the same error while upgrading linux-generic to

Mario Limonciello (superm1) wrote :

Someone with this problem, can you please add the following details:

* dkms status
* ls /var/lib/dkms -R

It sounds like some package was not properly cleaning up, most likely not DKMS's fault directly.

Jani Uusitalo (uusijani) wrote :

Mario, here's output from the commands you asked.

Beto1917 (beto-mst) wrote :

also affects me, running

iwtctw (avalonofsaber) wrote :

same to me, it happens every time where building module with kernel

output of "dkms status":
blcr, 0.8.2: added
fglrx-updates, 8.911, 3.0.0-16-generic, i686: installedError! Could not locate dkms.conf file.
File: does not exist.

output of "ls /var/lib/dkms -R" is attached

Christian Assig (chrassig) wrote :

This looks like a bug in the virtualbox package you have installed.

Go to the directory /var/lib/dkms/vboxhost, and make sure to delete any directories belonging to previous versions of virtualbox that you no longer have installed.

@iwtctw (avalonofsaber): Delete /var/lib/dkms/vboxhost/4.0.8/
@Jani Uusitalo (uusijani): Delete /var/lib/dkms/vboxhost/4.1.4/

Or have a look at the following page for more details:

Christian Assig (chrassig) wrote :

If you have installed virtualbox from instead of the version from the official Ubuntu repositories, this upstream bug about the same topic might also be of interest for you:

Teo (teo1978) wrote :

I have the same issue and I don't see any subdirectory belonging to older versions of VB in /var/lib/dkms/vboxhost

/var/lib/dkms/vboxhost$ ls -la
total 12
drwxr-xr-x 3 root root 4096 May 23 20:07 .
drwxr-xr-x 7 root root 4096 May 23 20:06 ..
drwxr-xr-x 4 root root 4096 May 23 20:07 4.1.14
lrwxrwxrwx 1 root root 28 May 23 20:07 kernel-3.2.0-24-generic-i686 -> 4.1.14/3.2.0-24-generic/i686

So VirtualBox developer say it's a bug in Ubuntu, and Ubuntu developers say it's a bug in VirtualBox..........

Nick Jenkins (nickpj) wrote :

You might have some other directories left over from an old version of virtualbox under /var/lib/dkms/ . For example, I had some directories left over from 3.2.6, and the fix for me was:

sudo rm -r /var/lib/dkms/vboxnetadp /var/lib/dkms/vboxdrv /var/lib/dkms/vboxnetflt

Basically you should check the timestamps of any directories under /var/lib/dkms that start with either 'vbox' or 'virtual'. If they're fairly old (e.g. > 1 year) then there's a reasonable chance that they might be cruft left over from an old version of VirtualBox. Deciding whether to delete them or not is at your discretion.

And really, there are 2 entirely separate software problems here:
1) VirtualBox should clean up after itself by removing these old directories when being uninstalled or upgraded.
2) dkms should be explicit and unambiguous about which directory it has a problem with. For example there would be a LOT less confusion all round if it said "Error in directory /var/lib/dkms/vboxdrv , belonging to package 'virtualbox' - Could not locate dkms.conf file." instead of the completely non-specific: "Error! Could not locate dkms.conf file."

Guntbert Reiter (guntbert) wrote :

@Nick Jenkins (nickpi)
That was a much needed clarification, thx - might it be a good idea to create a new bug against dkms just with your item (2) ? (and maybe the virtualbox issue as an example)

LAZA (laza74) on 2013-02-01
tags: added: precise
Tero Ratilainen (unksi) wrote :

Happens with quantal too:

run-parts: executing /etc/kernel/postinst.d/dkms 3.5.0-26-generic /boot/vmlinuz-3.5.0-26-generic
Error! Could not locate dkms.conf file.
File: does not exist.

tags: added: quantal
mrDoctorWho (mrdoctorwho) wrote :

Happens with raring (system was updated by update-manager 12.10→13.04):

run-parts: executing /etc/kernel/header_postinst.d/dkms 3.8.0-17-generic /boot/vmlinuz-3.8.0-17-generic
Error! Could not locate dkms.conf file.
File: does not exist.

jimav (james-avera) wrote :

(work around)
This cleared the error for me:

  sudo apt-get remove virtualbox-4.2
  sudo rm -rf /var/lib/dkms/vboxhost
  sudo apt-get install virtualbox-4.2

Wow! This bug was reported in 2011 and still occuring.

Ro$k0 (kroskoliy) wrote :

Yeah. And this is not "wow" at all. Same bug on 13.04 x32.

tags: added: raring

The bug is BACK!

Setting up linux-image-3.8.0-31-generic (3.8.0-31.46) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.8.0-31-generic /boot/vmlinuz-3.8.0-31-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.8.0-31-generic /boot/vmlinuz-3.8.0-31-generic
Error! Could not locate dkms.conf file.
File: does not exist.

Alejandro Arcos (arcosaf) wrote :
Download full text (16.7 KiB)

Is Back ?

sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  linux-headers-3.11.0-13 linux-headers-3.11.0-13-generic linux-image-3.11.0-13-generic
The following packages will be upgraded:
  account-plugin-aim account-plugin-jabber account-plugin-salut account-plugin-yahoo
  at-spi2-core empathy empathy-common gir1.2-atspi-2.0 gnome-control-center
  gnome-control-center-data libatspi2.0-0 libgnome-control-center1 libkpathsea6
  liblightdm-gobject-1-0 libptexenc1 lightdm linux-generic linux-headers-generic
  linux-image-generic linux-libc-dev mcp-account-manager-uoa nautilus-sendto-empathy
  openssh-client python-cupshelpers python3-update-manager ssh-askpass-gnome
  system-config-printer-common system-config-printer-gnome system-config-printer-udev
  texlive-binaries update-manager update-manager-core
32 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 74,5 MB of archives.
After this operation, 258 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 saucy-updates/main libatspi2.0-0 amd64 2.10.1-0ubuntu0.1 [66,7 kB]
Get:2 saucy-updates/main lightdm amd64 1.8.4-0ubuntu1 [111 kB]
Get:3 saucy-updates/main linux-image-3.11.0-13-generic amd64 3.11.0-13.20 [13,9 MB]
Get:4 saucy-updates/main openssh-client amd64 1:6.2p2-6ubuntu0.1 [490 kB]
Get:5 saucy-updates/main python3-update-manager all 1:0.194.1 [34,9 kB]
Get:6 saucy-updates/main update-manager-core all 1:0.194.1 [5.364 B]
Get:7 saucy-updates/main update-manager all 1:0.194.1 [559 kB]
Get:8 saucy-updates/main nautilus-sendto-empathy amd64 3.8.4-1ubuntu2 [11,8 kB]
Get:9 saucy-updates/main mcp-account-manager-uoa amd64 3.8.4-1ubuntu2 [25,1 kB]
Get:10 saucy-updates/main account-plugin-yahoo amd64 3.8.4-1ubuntu2 [8.834 B]
Get:11 saucy-updates/main account-plugin-salut amd64 3.8.4-1ubuntu2 [8.864 B]
Get:12 saucy-updates/main account-plugin-jabber amd64 3.8.4-1ubuntu2 [8.840 B]
Get:13 saucy-updates/main account-plugin-aim amd64 3.8.4-1ubuntu2 [8.826 B]
Get:14 saucy-updates/main empathy amd64 3.8.4-1ubuntu2 [573 kB]
Get:15 saucy-updates/main empathy-common all 3.8.4-1ubuntu2 [1.519 kB]
Get:16 saucy-updates/main at-spi2-core amd64 2.10.1-0ubuntu0.1 [52,0 kB]
Get:17 saucy-updates/main gir1.2-atspi-2.0 amd64 2.10.1-0ubuntu0.1 [16,7 kB]
Get:18 saucy-updates/main libgnome-control-center1 amd64 1:3.6.3-0ubuntu45.1 [80,4 k...

Le Gluon Du Net (legluondunet) wrote :

I have this bug on saucy

tags: added: saucy
Changed in dkms (Ubuntu):
importance: Undecided → High
Allan Kelly (wolasallank) wrote :

Seems to still be occurring on trusty

John Center (john-center) wrote :

The same thing happened to me on trusty, amd64 with the latest version of virtualbox 4.3.18. The strange thing is, dkms.conf was located in /var/lib/dkms/vboxhost/4.3.18/build/, but locate couldn't find it. It found the previous one, v4.3.16, but not the latest one. Only with "find" could I locate it.

Woonjas (woonjas) wrote :

Just remove the files and directories belonging to the old version(s) in /var/lib/dkms/vboxhost and run "sudo /etc/init.d/vboxdrv setup" again to fix it.

John Center (john-center) wrote :

Thanks for the info. I followed your instructions & the message went away. I had had a lockup of my system, probably caused by the old kernel modules were stilled being loaded. Hopefully this clears it up. -John

Ted George (tedlz000) wrote :

To simply remove the files and directories for older versions in /var/lib/dkms/vboxhost is enough to solve this problem. And it is a bug in VirtualBox instead of Ubuntu. VirtualBox should purge the older dkms files everytime when it is installed or reinstalled.

Ted George (tedlz000) wrote :

And in addition, there's a bug in the dkms script. The string $"File: $conf does not exist." around line 462 of the file /usr/bin/dkms or /usr/sbin/dkms should be replaced into $"File: $read_conf_file does not exist." because $conf is empty when it is executed here. That's why the output is "File: does not exist." without any information about the filename.

Ted George (tedlz000) on 2015-07-17
description: updated
tags: added: xenial
tags: added: zesty
spike speigel (frail-knight) wrote :

I'm seeing this in 16.04.2 LTS.

During dist-upgrade I see:

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

I too have been having VBox issues, such as locking up my system.

$ sudo apt-cache policy virtualbox dkms
  Installed: 5.0.36-dfsg-0ubuntu1.16.04.2
  Candidate: 5.0.36-dfsg-0ubuntu1.16.04.2
  Version table:
 *** 5.0.36-dfsg-0ubuntu1.16.04.2 500
        500 xenial-updates/multiverse amd64 Packages
        100 /var/lib/dpkg/status
     5.0.18-dfsg-2build1 500
        500 xenial/multiverse amd64 Packages
  Version table:
 *** 500
        500 xenial-updates/main amd64 Packages
        500 xenial-updates/main i386 Packages
        100 /var/lib/dpkg/status 500
        500 xenial/main amd64 Packages
        500 xenial/main i386 Packages

spike speigel (frail-knight) wrote :

Ok...For anyone with a Dell XPS 13 9360 who experiences an issue like this:

So I decided to purge and reinstall DKMS:

sudo apt-get purge dkms

BUT that removes all the following:

dkms hid-multitouch-dkms intel-hid-dkms intel-vbutton-dkms oem-audio-hda-daily-dkms virtualbox-dkms

I purged, then went in and manually deleted /var/ib/dkms and all its folders. I thought I could just copy/paste that line above with apt-get install to reinstall everything. I was wrong.

I have a Dell XPS 13 9360 Developer Edition laptop which has some Dell provided driver kernel modules.

oem-audio-hda-daily-dkms was available on their update repo. That was installed by apt-get just fine.

hid-multitouch-dkms intel-hid-dkms intel-vbutton-dkms were NOT available in their update repo. I had to pull those from the Dell OEM Recovery ISO they offer of Ubuntu 16.04 LTS.

I installed them using dpkg.

I then found the following to rebuild kernel modules:

ls /var/lib/initramfs-tools | \
    sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start

All appears fine again, but what a pain!!!

Nazar Mokrynskyi (nazar-pc) wrote :

Seriously, this bug is open for almost 6!!! years!!!
Why can't someone figure out why on every kernel update we have to manually run dkms command to compile VirtualBox, Nvidia and other modules?

I saw this during an upgrade to Artful. Deleting /var/lib/dkms/virtualbox and /var/lib/dkms/vboxhost, then 'aptitude reinstall virtualbox-dkms' seems to have resolved the problem.

dino99 (9d9) on 2017-10-14
Changed in dkms (Ubuntu):
status: Confirmed → Incomplete
tags: removed: oneiric quantal raring saucy
summary: - [Oneiric] Error during kernel upgrade: Could not locate dkms.conf file
+ Error during kernel upgrade: Could not locate dkms.conf file
Nazar Mokrynskyi (nazar-pc) wrote :

And why was this marked incomplete? It definitely happens to a lot of people.

dino99 (9d9) wrote :


this has been an issue long time ago, but has been fixed since a while (apt). So this is more a user maintenance problem now rather a bug. I suppose this concern many 'rolling' installations where users:
- have left behind old disturbing setting
- rarely/never clean their system: clean/autoclean/autoremove/bleachbit
- and/or mixed DEs where conflicts are often met.

As an example , see the #31 comment above, which point the lack of maintenance and/or installation made without the metapackage guidance.

Nazar Mokrynskyi (nazar-pc) wrote :

It is an issue for a lot of people here and today, on up to date Ubuntu version. I'm living on development version of Ubuntu for few years now and it is a pain to manually run dkms for each driver after each kernel upgrade. And I'm regularly cleaning my system from old packages and other garbage.

I'd like this to be marked as "Confirmed" again since it is definitely not "Incomplete" and definitely not fixed yet. And I'd like this to be fixed eventually.

dino99 (9d9) wrote :

Then point to the distro used, and expose your issue to their devs. Give them details about which version/source are problematic, if extra packages (ppa, ...)/ custom compiled source ... are also used.
Dkms is not evolved and so will not get fix. That report is useless.

Nazar Mokrynskyi (nazar-pc) wrote :

Well, this is an issue reported against DKMS package in particular distro: Ubuntu. Not against DKMS as such. It happens on development version of Ubuntu for a long time, can't say how long exactly. Apparently, issue is present since 2011 and is triggered under certain conditions.

From my understanding the problem is in Ubuntu's DKMS package, since regardless of actual module being compiled I always get the same issue. It might be some hook error or something else, but when I update Ubuntu's native kernel while having VirtualBox installed from Ubuntu's native repository, DKMS should compile kernel modules without issues automatically, but currently it doesn't.

If that is not an issue in DKMS package, which is possible, then mark it as affecting another relevant package, but there is something going on wrong that should be fixed and people are suffering from it (71 marked as affected as of right now).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.