如何安装 virtualbox (Ubuntu Trusty Tahr)

如何安装 virtualbox (Ubuntu Trusty Tahr)

我一直试图从官方 ppa 安装虚拟盒(本指南https://www.virtualbox.org/wiki/Linux_Downloads)但后来我尝试安装

sudo apt-get install virtualbox-4.3 

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libsdl-ttf2.0-0
The following NEW packages will be installed:
  libsdl-ttf2.0-0 virtualbox-4.3
0 upgraded, 2 newly installed, 0 to remove and 148 not upgraded.
Need to get 0 B/68.6 MB of archives.
After this operation, 154 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package libsdl-ttf2.0-0:amd64.
(Reading database ... 186449 files and directories currently installed.)
Unpacking libsdl-ttf2.0-0:amd64 (from .../libsdl-ttf2.0-0_2.0.11-3_amd64.deb) ...
Selecting previously unselected package virtualbox-4.3.
Unpacking virtualbox-4.3 (from .../virtualbox-4.3_4.3.6-91406~Ubuntu~raring_amd64.deb) ...
Processing triggers for ureadahead ...
Processing triggers for shared-mime-info ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils ...
Processing triggers for mime-support ...
Processing triggers for gnome-menus ...
Processing triggers for hicolor-icon-theme ...
Setting up libsdl-ttf2.0-0:amd64 (2.0.11-3) ...
Setting up virtualbox-4.3 (4.3.6-91406~Ubuntu~raring) ...
addgroup: The group `vboxusers' already exists as a system group. Exiting.
Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMSError! Your kernel headers for kernel 3.8.0-34-generic cannot be found.
Please install the linux-headers-3.8.0-34-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
 ...failed!
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules ...failed!
  (Look at /var/log/vbox-install.log to find out what went wrong)
Processing triggers for libc-bin ...

我无法安装 linux-headers-3.8.0-34-generic

 s apt-get install linux-headers-3.8.0-34-generic                                                                                                          
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-headers-3.8.0-34-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-headers-3.8.0-34-generic' has no installation candidate

日志

 cat /var/log/vbox-install.log                                                                                                    
Uninstalling modules from DKMS
Attempting to install using DKMS

Creating symlink /var/lib/dkms/vboxhost/4.3.6/source ->
                 /usr/src/vboxhost-4.3.6

DKMS: add completed.
Failed to install using DKMS, attempting to install without
Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.

有人能帮助我吗?PS:抱歉我写错了。英语不是我的母语。

答案1

该内核已过时,不再存在于存储库中。

尝试这些:

uname -a

请将其输出附加到问题中。

更新内核

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install linux-generic

重启,检查内核是否升级:

uname -a

然后用虚拟框再查看。

相关内容