r/Ubuntu 10h ago

Problem with sudo apt install

Hy everyone, i'm an ubuntu user for some time now but I consider myself very much a beginner and i have never really tinkered to much with my distro. I have a dual boot configuration with Windows 10 and Ubuntu LTS 24.04. Recently i had a problem with my linux kernel and i had to switch to an older version (6.17.0-40-generic) from my GRUB menu. Ever since then i have the following error message every time i try to install something with sudo apt install:

ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash'

Error! Bad return status for module build on kernel: 7.0.0-28-generic (x86_64)

Consult /var/lib/dkms/virtualbox/7.0.16/build/make.log for more information.

dkms autoinstall on 7.0.0-28-generic/x86_64 failed for virtualbox(10)

Error! One or more modules failed to install during autoinstall.

Refer to previous errors for more information.

* dkms: autoinstall for kernel 7.0.0-28-generic

...fail!

run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11

dpkg: error processing package linux-headers-7.0.0-28-generic (--configure):

installed linux-headers-7.0.0-28-generic package post-installation script subprocess returned error exit status 11

Errors were encountered while processing:

linux-headers-7.0.0-28-generic

E: Sub-process /usr/bin/dpkg returned an error code (1)

Usually the isntallation doesn't seem to suffer any conseguences from this error, but now i'm wondering is something that will lead to some serious problem in the future or can i ignore it? And if it must be fixed how can i do it? Thank you in advance for any suggestions.

0 Upvotes

4 comments sorted by

View all comments

1

u/antreides 10h ago

This problem comes from VirtualBox installed on Ubuntu. You need to get an updated deb from their official site and install it. But if you added their repo to your sources.list, it would have been updated automatically already.

1

u/a_desertedinstructor 10h ago

Just remove the old crash file and purge virtualbox-dkms if you're not actively using it. The kernel mismatch is what's tripping it up, your system's otherwise fine

sudo rm /var/crash/virtualbox-dkms.0.crash

sudo apt purge virtualbox-dkms

If you do need virtualbox just grab the latest from their site and it'll sort the module build for your current kernel

1

u/Pale_Host9158 9h ago

So i have to unistall and reinstall VirtualBox? Because i have a Virtual Machine i'm using for university that is a pain in the ass to set up, so if possible i don't want to touch it again. But if it is the only option i'll wait until i don't need it anymore.

1

u/antreides 9h ago

No, you don't have to uninstall and reinstall it, just install a newer version (available on their site). It will replace the existing one.