Not so much as a question as a documentation.
This is regarding a failing apt-get install
or update
related to virtualbox 6.1.10, Ubuntu 20.04, and virtualbox-dkms package failing to build.
I had an issue recently with Ubuntu 20.04 and Virtual Box 6.1.10 that's similar to what has been documented here and here.
The issue was that installing virtual box from the ubuntu software center installed v6.1.10 which is incompatible with the current ubuntu kernel version, v 5.8.xx.
These are all known issues, however my problem arose when I erroneously tried reinstalling vbox from the package store. Previously, virtualbox-dkms, had been compiled and reinstalling removes the functioning package and which fails with an error (status 10
). So I ended up with an error like this:
Loading new virtualbox-6.1.10 DKMS files...
Building for 5.8.0-36-generic
Building initial module for 5.8.0-36-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash'
Error! Bad return status for module build on kernel: 5.8.0-36-generic (x86_64)
Consult /var/lib/dkms/virtualbox/6.1.10/build/make.log for more information.
dpkg: error processing package virtualbox-dkms (--configure):
installed virtualbox-dkms package post-installation script subprocess returned error exit status 10
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
virtualbox-dkms
This error can be seen either at:
cat /var/log/apt/history.log
---or---
/var/log/apt/term.log
In order to fix this I reinstalled virtualbox v.6.1.16 directly from their website following the instructions found here.
However on subsequent updates I was still receiving the same error regarding virtualbox-dkms, even though the process was no longer used. So, in order to fix this, following this site.
I copied the post install script that was causing failure:
sudo mv /var/lib/dpkg/info/virtualbox-dkms.postinst ./virtualbox-dkms.postinst.bac
then purged the remaining dkms files for the old virtualbox installation and did an update:\
sudo apt-get purge virtualbox-dkms
sudo apt-get update && sudo apt-get upgrade
So far no issues! Hope this helps someone else!
TLDR: Tried to reinstall to fix virtualbox v6.10 from ubuntu software manager. v6.10 has issue with ubuntu 20.04 kernel v5.8. To fix broken package, virtualbox-dkms, remove post-install script and purge old virtualbox v6.1.10 files and install virtualbox directly from their website to get virtualbox ^v6.1.16.
I have the same problem too and were able to solve with this steps: First, update and upgrade your ubuntu 20.04 with
sudo apt-get update
sudo apt-get upgrade
then, delete the existing dkms tree
package
sudo apt-get remove virtualbox-dkms
Proceed to delete the virtualbox
sudo apt-get remove virtualbox
sudo apt-get autoremove
Download the installer from Virtualbox Download Page
wget https://download.virtualbox.org/virtualbox/6.1.16/virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb
Install the package
sudo dpkg -i virtualbox-6.1_6.1.16-140961_Ubuntu_eoan_amd64.deb
The installation may failed because of some dependency, try running sudo apt-get install -f
and then install the package again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With