Imagine that you have Debian 10, kernel version 5.10, and a self-made DEB package that compiles and installs a kernel module using the dkms subsystem. As expected, the package has a dependency on dkms. However, when you tried to install this package with the command
apt install -y ./my-dkms-package.deb
you found that the installer sees that dkms is missing from the system and started its installation. However, dkms also has its dependencies, one of which is linux-headers-common for kernel version 4.19!
Thus, despite having only the active kernel version 5.10 in your system, dependencies for kernel version 4.19 are being installed.
And here comes the strange part - during the package installation and module compilation, headers from kernel version 4.19 are being used!
After that, you see that an error occurs during compilation because (make.log)
/lib/module/linux-4.19 is not found
and the installation cannot be completed.
But as it turns out, there is a way to solve this problem!
If you install dkms separately with the command
apt install dkms
the installed dependencies from kernel version 4.19 will no longer interfere. And after that, you can install your package with the command
apt install -y ./my-dkms-package.deb
and all headers will be correct, i.e., for kernel version 5.10.
So if you encounter such a problem, don't despair! Just install dkms separately, and everything will be fine.
Top comments (0)