Ubuntu下使用virtualbox安裝虛擬機,遇到'/etc/init.d/vboxdrv setup'問題: linux
root@perfIan:~# apt-get install linux-headers-'uname -r' Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package linux-headers-uname -r
root@perfIan:~# /etc/init.d/vboxdrv setup * Stopping VirtualBox kernel modules [ OK ] * Uninstalling old VirtualBox DKMS kernel modules [ OK ] * Trying to register the VirtualBox kernel modules using DKMS Error! Your kernel headers for kernel 3.5.0-34-generic cannot be found. Please install the linux-headers-3.5.0-34-generic package, or use the --kernelsourcedir option to tell DKMS where it's located * Failed, trying without DKMS * Recompiling VirtualBox kernel modules * Look at /var/log/vbox-install.log to find out what went wrong
root@perfIan:~# apt-get install linux-headers-3.5.0-34-generic Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: linux-headers-3.5.0-34 The following NEW packages will be installed: linux-headers-3.5.0-34 linux-headers-3.5.0-34-generic 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 13.1 MB of archives. After this operation, 70.1 MB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://cn.archive.ubuntu.com/ubuntu/ quantal-updates/main linux-headers-3.5.0-34 all 3.5.0-34.55 [12.1 MB] Get:2 http://cn.archive.ubuntu.com/ubuntu/ quantal-updates/main linux-headers-3.5.0-34-generic amd64 3.5.0-34.55 [958 kB] Fetched 13.1 MB in 6min 8s (35.4 kB/s) perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:en:zh_CN:zh", LC_ALL = (unset), LC_TIME = "zh_CN.UTF-8", LC_MONETARY = "zh_CN.UTF-8", LC_ADDRESS = "zh_CN.UTF-8", LC_TELEPHONE = "zh_CN.UTF-8", LC_NAME = "zh_CN.UTF-8", LC_MEASUREMENT = "zh_CN.UTF-8", LC_IDENTIFICATION = "zh_CN.UTF-8", LC_NUMERIC = "zh_CN.UTF-8", LC_PAPER = "zh_CN.UTF-8", LANG = "en_US.UTF-8:zh_CN.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Selecting previously unselected package linux-headers-3.5.0-34. (Reading database ... 153374 files and directories currently installed.) Unpacking linux-headers-3.5.0-34 (from .../linux-headers-3.5.0-34_3.5.0-34.55_all.deb) ... Selecting previously unselected package linux-headers-3.5.0-34-generic. Unpacking linux-headers-3.5.0-34-generic (from .../linux-headers-3.5.0-34-generic_3.5.0-34.55_amd64.deb) ... Setting up linux-headers-3.5.0-34 (3.5.0-34.55) ... Setting up linux-headers-3.5.0-34-generic (3.5.0-34.55) ... Examining /etc/kernel/header_postinst.d. run-parts: executing /etc/kernel/header_postinst.d/dkms 3.5.0-34-generic /boot/vmlinuz-3.5.0-34-generic
root@perfIan:~# /etc/init.d/vboxdrv setup * Stopping VirtualBox kernel modules [ OK ] * Uninstalling old VirtualBox DKMS kernel modules [ OK ] * Trying to register the VirtualBox kernel modules using DKMS [ OK ] * Starting VirtualBox kernel modules [ OK ]一步步按照操做,很快搞定。