How do I fix a error on a failed module build for Virtualbox?

12,726

Solution 1

1.) sudo apt-get remove virtualbox

2.) reboot

3.) sudo ln -si /usr/bin/gcc-4.6 /usr/bin/gcc

4.) reboot

4.) sudo apt-get install virtualbox

5.) optional reboot. :)

that all kids..!!

Solution 2

You can check the error in the log, in most case it used a gcc/g++ option that not supported in your current version.

You can install a newer version of gcc and g++, and manage with update-alternatives. https://stackoverflow.com/questions/7832892/how-to-change-the-default-gcc-compiler-in-ubuntu

After that reinstall virtualbox-dkms.

 sudo apt-get --reinstall install virtualbox-dkms
Share:
12,726

Related videos on Youtube

X_o
Author by

X_o

what about you ?

Updated on September 18, 2022

Comments

  • X_o
    X_o over 1 year

    world. I'm trying to upgrade my system but I get the error:

    Error! Bad return status for module build on kernel: 3.2.0-37-generic (i686)

    Deleting module version: 4.1.12
    completely from the DKMS tree.
    ------------------------------
    Done.
    Loading new virtualbox-4.1.12 DKMS files...
    First Installation: checking all kernels...
    Building only for 3.2.0-37-generic
    Building initial module for 3.2.0-37-generic
    Error! Bad return status for module build on kernel: 3.2.0-37-generic (i686)
    Consult /var/lib/dkms/virtualbox/4.1.12/build/make.log for more information.
    dpkg: error processing virtualbox-dkms (--configure):
     subprocess installed post-installation script returned error exit status 10
    Errors were encountered while processing:
     virtualbox-dkms
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    
    • Nathan J.B.
      Nathan J.B. about 11 years
      What exactly are you trying to upgrade? Ubuntu? Upgrading the entire OS to 12.10 or just upgrading the packages on your current Ubuntu? Or are you trying to upgrade only VirtualBox? etc
    • X_o
      X_o about 11 years
      I just want to update the system. that error I get it since I made the last update.
    • Nathan J.B.
      Nathan J.B. about 11 years
      So this is as a result of sudo apt-get upgrade?
    • guntbert
      guntbert about 11 years
      Did you look into /var/lib/dkms/virtualbox/4.1.12/build/make.log like the error message suggested? You can edit your question to post it or (if it is too big) use pastebin.ubuntu.com and put the link into your question.
    • X_o
      X_o about 11 years
      LD /var/lib/dkms/virtualbox/4.1.12/build/built-in.o LD /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/built-in.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/linux/SUPDrv-l‌​inux.o Unable to exec gcc.real: No such file or directory make[2]: *** [/var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/linux/SUPDrv-‌​linux.o] Error 2 make[1]: *** [/var/lib/dkms/virtualbox/4.1.12/build/vboxdrv] Error 2 make: *** [_module_/var/lib/dkms/virtualbox/4.1.12/build] Error 2 make: Leaving directory `/usr/src/linux-headers-3.2.0-37-generic'
  • David Millar
    David Millar over 9 years
    Must it be 4.6? On my machine /usr/bin/gcc is already symlinked to gcc-4.7