2

So I tried to install virtual box on my 18.04. It told me to reinstall virtualbox dkms. After looking around the forums I determined I needed to run sudo apt-get --reinstall virtualbox-dkms. When I do, Ubuntu says dpkg was interrupted. you must manually run sudo dpkg --configure -a to correct the problem. I do this and it just hangs forever. Am I missing something I need to fix this?

Edit: The line it gets stuck on is:

building initial module for 4.15.0-23 generic
gbux
  • 31

2 Answers2

0

It seems like this is an issue with secure boot, I have the same problem and found the solution in this forum: https://ubuntuforums.org/showthread.php?t=2393436.

Try to reboot and disable Secure Boot, then reboot, and either reinstall virtualbox-dkms or run dpkg-reconfigure virtualbox-dkms. It should work now.

If you want secure boot to work still, you then need to re-enable secure boot and sign the modules following this guide: https://blog.ubuntu.com/2017/08/11/how-to-sign-things-for-secure-boot

This is unfortunate, because it means if you want secure boot enabled, then every time there is a kernel upgrade, you need to:

  1. Reboot and disable secure boot
  2. Run dpkg-reconfigure virtualbox-dkms
  3. Reboot and re-enable secure boot
  4. Sign all the new modules
  5. Reboot one last time (or possibly just modprobe the modules)

That is a lot of fuss and rebooting, but it should at least work. Of course, you could also just leave secure boot disabled until you reboot into Windows.

Edit:

There is a better way to do this that does not require multiple reboots. Apparently, what is happening is that the MOK module signing is waiting in the background for a root password. Check out this answer for more information: reconfiguration issues with dpkg

Mike D
  • 113
0

What fixed it for me was running Ubuntu's "Software Updater" in graphical mode and rebooting as it asked me to do. Terminal apt is back to normal :)

Ramon Suarez
  • 1,861