Q: VirtualBox kernel driver installation uses bogus kernel version I meet a problem installing Virtualbox kernel driver on Ubuntu MATE 20.04.
The running kernel is 5.4.0-58-generic x86_64.
No UEFI.
Reinstalling goes like this:
$ sudo /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
depmod: WARNING: could not open modules.order at /lib/modules/5.4.73: No such file or directory
depmod: WARNING: could not open modules.builtin at /lib/modules/5.4.73: No such file or directory
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

5.4.73 is a bogus kernel version and if /lib/modules/5.4.73 doesn't exist, vboxconfig creates it.
But it obviously lacks its normal content and vboxconfig fails.
Certainly not the duplicate of another question (read twice)
The questions are:

*

*where does vboxconfig pick that bogus instead of true name?

*what safe action should I take to circumvent that?
safe means not risking a unbootable system and might be a kernel update installation.

TIA.

A: (too long for a comment) with outcome at the end
Thanks a lot for your reply mchid.
Yes,  5.4.0.58.61 is installed beside linux-generic 5.4.0.58.61.
I started scanning / for "5.4.73" but before the first hit started displaying your command showed that kernel.release contains that value. Strangely, this mis-installation results from the 20.04 upgrade.
My first idea was to patch kernel.release but I found other files with the bad value and the extent of the damage is unpredictable.
So, the best option is what you said:
sudo apt install --reinstall linux-generic
The following NEW packages will be installed:
linux-headers-5.4.0-117   linux-headers-5.4.0-117-generic   linux-image-5.4.0-117-generic
linux-modules-5.4.0-117-generic   linux-modules-extra-5.4.0-117-generic
The following packages will be upgraded:
linux-generic   linux-headers-generic   linux-image-generic

Unlike a normal reinstall, the old kernel remains unaffected and I'm not sawing the bough I'm sitting on, right?
Thanks again.
Outcome
Kernel installation worked as said with sensible messages except
/etc/kernel/postinst.d/vboxadd:
vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.

and there is no vboxadd-install.log
Virtualbox requested the hosts additions and then ran OK again.
Phew !!!
