On a 22.04 Ubuntu I have my dkms module installed on a 6.8.0-87-generic kernel.
When I upgrade Ubuntu from 22.04 to 24.04, DKMS correctly installs the module on the new kernel 6.8.0-88-generic and the module runs fine on it.
However, booting into the older kernel once the upgrade is finished will fail to load the DKMS module, with dmesg printing:
module: disagrees about version of symbol X
module: Unknown symbol X (err -22)
If I reinstall the dkms debian package on the older kernel after the upgrade the issue gets resolved, but I'm curious if there's a way to prevent this.