1. 程式人生 > >debian9.6安裝virtualbox

debian9.6安裝virtualbox

注意這裡是virtualbox,不是vmware。

1,下載

 官網:https://www.virtualbox.org/wiki/Linux_Downloads

我的是debian9.6,所以下載debian9,

 2,驗證下載的包是不是正確的

[email protected]:~/下載$ sha256sum virtualbox-6.0_6.0.0-127566~Debian~stretch_amd64.deb 
57bf19d6bbd61a87d02b653dd7ba066fdfcdaf12d489815aeaf172e8b2d55057  virtualbox-6.0_6.0.0-127566~Debian~stretch_amd64.deb

原sha256碼:

 沒問題,繼續。

3,第一次安裝

[email protected]:~/下載$ sudo dpkg -i virtualbox-6.0_6.0.0-127566~Debian~stretch_amd64.deb 

發現問題

dpkg: 依賴關係問題使得 virtualbox-6.0 的配置工作不能繼續:
 virtualbox-6.0 依賴於 libcurl3 (>= 7.16.2);然而:
  未安裝軟體包 libcurl3。
 virtualbox-6.0 依賴於 libqt5opengl5 (>= 5.0.2);然而:
  未安裝軟體包 libqt5opengl5。
 virtualbox-6.0 依賴於 libqt5printsupport5 (>= 5.0.2);然而:
  未安裝軟體包 libqt5printsupport5。

dpkg: 處理軟體包 virtualbox-6.0 (--install)時出錯:
 依賴關係問題 - 仍未被配置

 解決依賴性,

[email protected]:~/下載$ sudo apt --fix-broken install

4,第二次安裝

[email protected]:~/下載$ sudo dpkg -i virtualbox-6.0_6.0.0-127566~Debian~stretch_amd64.deb 

又出現問題,

This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-amd64 linux-headers-4.9.0-8-amd64
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-amd64 linux-headers-4.9.0-8-amd64

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.

安裝header,

[email protected]:~/下載$ sudo apt-get install linux-headers-4.9.0-8-amd64

 有兩個選項 linux-headers-amd64和linux-headers-4.9.0-8-amd64,為什麼選這個,是因為:

[email protected]:~/下載$ uname -a
Linux bogon 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux

5,第三次安裝

[email protected]:~/下載$ sudo dpkg -i virtualbox-6.0_6.0.0-127566~Debian~stretch_amd64.deb 

就沒有問題了,在搜尋欄,有一個virtualbox圖示:

6,開啟,如下:

 參考:https://blog.csdn.net/Oliver_ZTJ/article/details/78339608