ubuntu 10.04 安装virtualbox 4.0

来源:互联网 发布:原始点 淘宝 编辑:程序博客网 时间:2024/06/01 10:02

以前安装过virtualbox,

现在再安装一遍。

直接装,源里头没有:

 

root@zhangbin-laptop:/home/zhangbin# apt-get install virtualbox

Reading package lists... Done

Building dependency tree       

Reading state information... Done

Package virtualbox 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 virtualbox has no installation candidate

 

http://www.virtualbox.org/wiki/Linux_Downloads

这里有官方安装说法:

 

Debian-based Linux distributions

Note: VirtualBox has been moved from non-free to contrib with 4.0, so please adjust your repository settings.

Add one of the following lines according to your distribution to your /etc/apt/sources.list:

deb http://download.virtualbox.org/virtualbox/debian maverick contribdeb http://download.virtualbox.org/virtualbox/debian lucid contribdeb http://download.virtualbox.org/virtualbox/debian karmic contribdeb http://download.virtualbox.org/virtualbox/debian jaunty contribdeb http://download.virtualbox.org/virtualbox/debian intrepid contribdeb http://download.virtualbox.org/virtualbox/debian hardy contribdeb http://download.virtualbox.org/virtualbox/debian squeeze contribdeb http://download.virtualbox.org/virtualbox/debian lenny contribdeb http://download.virtualbox.org/virtualbox/debian etch contrib

The Oracle public key for apt-secure can be downloaded here. You can add this key with

sudo apt-key add oracle_vbox.asc

or combine downloading and registering:

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

The key fingerprint is

7B0F AB3A 13B9 0743 5925  D9C9 5442 2A4B 98AB 5139Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org>

(As of VirtualBox 3.2, the signing key was changed. The old Sun public key for apt-secure can be downloadedhere.)

To install VirtualBox, do

sudo apt-get updatesudo apt-get install virtualbox-4.0

Replace virtualbox-4.0 by

  • virtualbox-3.2 to install VirtualBox 3.2.12
  • virtualbox-3.1 to install VirtualBox 3.1.8
  • virtualbox-3.0 to install VirtualBox 3.0.14
  • virtualbox-2.2 to install VirtualBox 2.2.4
  • virtualbox-2.1 to install VirtualBox 2.1.4
  • virtualbox-2.0 to install VirtualBox 2.0.12
  • virtualbox to install VirtualBox 1.6.6

Note: Ubuntu/Debian users might want to install the dkms package to ensure that the VirtualBox host kernel modules (vboxdrvvboxnetflt and vboxnetadp) are properly updated if the linux kernel version changes during the next apt-get upgrade. For Debian it is available in Lenny backports and in the normal repository for Squeeze and later. The dkms package can be installed through the Synaptic Package manager or through the following command:

sudo apt-get install dkms

What to do when experiencing The following signatures were invalid: BADSIG ... when refreshing the packages from the repository?

# sudo -s -H# apt-get clean# rm /var/lib/apt/lists/*# rm /var/lib/apt/lists/partial/*# apt-get clean# apt-get update
========================================================
更新了sources.list之后,
apt-get update 之后。
root@zhangbin-laptop:/home/zhangbin# apt-get install virtualboxReading package lists... DoneBuilding dependency tree       Reading state information... DoneNote, selecting virtualbox-4.0 instead of virtualboxSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies:  virtualbox-4.0: Depends: libqtcore4 (>= 4:4.7.0~beta1) but 4:4.6.2-0ubuntu5.1 is to be installed                  Depends: libqtgui4 (>= 4:4.7.0~beta1) but 4:4.6.2-0ubuntu5.1 is to be installed                  Depends: libssl0.9.8 (>= 0.9.8m-1) but 0.9.8k-7ubuntu8.6 is to be installedE: Broken packages
看上去依赖的是qt4 的库。
原因是应该只保留lucide这个发行版,这个是ubuntu 10.04。
这会就可以了。
root@zhangbin-laptop:/home/zhangbin# apt-get install virtualbox
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting virtualbox-4.0 instead of virtualbox
The following extra packages will be installed:
  dkms libmng1 libqt4-network libqt4-opengl libqtcore4 libqtgui4 libsdl-ttf2.0-0 virtualbox-4.0
Suggested packages:
  qt4-qtconfig
The following NEW packages will be installed:
  dkms libmng1 libqt4-network libqt4-opengl libqtcore4 libqtgui4 libsdl-ttf2.0-0 virtualbox-4.0
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 65.1MB of archives.
After this operation, 133MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  virtualbox-4.0
Install these packages without verification [y/N]? y
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  virtualbox-4.0
Install these packages without verification [y/N]? y
Get:1 http://download.virtualbox.org/virtualbox/debian/ lucid/contrib virtualbox-4.0 4.0.4-70112~Ubuntu~lucid [58.4MB]
0% [1 virtualbox-4.0 336kB/58.4MB 0%]^C                       

官网上的virtualbox下不回来。
先不下了。
安装key
root@zhangbin-laptop:/media/WinHome/ffmpeg# sudo apt-key add oracle_vbox.asc
gpg: can't open `oracle_vbox.asc': No such file or directory
root@zhangbin-laptop:/media/WinHome/ffmpeg# sudo apt-key add oracle_vbox.asc
gpg: can't open `oracle_vbox.asc': No such file or directory
看来是路径没搞对。
下回来这个asc文件,然后
root@zhangbin-laptop:/home/zhangbin/下载# ls
fcitx-3.6.3      google-chrome-stable_current_i386.deb  linuxqq_v1.0.2_i386.tar.gz
fcitx-3.6.3.tar  linuxqq_v1.0.2_i386                    oracle_vbox.asc
root@zhangbin-laptop:/home/zhangbin/下载# sudo apt-key add oracle_vbox.asc
OK
======
在官网用浏览器直接下,速度还挺快的。真是不知道为啥终端不行。
然后成功安装拉。