centos中VirtualBox安裝錯誤問題解決辦法

來源:互聯網
上載者:User


核心提示:

檢查/lib/module/{核心版本號碼}/kernel/目錄下的檔案(符號連結) header,及source是否有效,它們應該鏈到你的核心編譯目錄裡

使用centos 6.x的linux,嫌內建核心太老,自己編譯的核心3.0.32.

virtualbox長期沒更新,今天更新一下,到vbox官方下載安裝包VirtualBox-4.2.12-84980-Linux_x86.run,sh 運行之,但得到提示:

 代碼如下 複製代碼

[root@fsc download]# sh VirtualBox-4.2.12-84980-Linux_x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox for Linux installation............
VirtualBox Version 4.2.12 r84980 (2013-04-12T10:19:13Z) installer
Please install the build and header files for your current Linux kernel.
The current kernel version is 3.0.32
Problems were found which would prevent VirtualBox from installing.
Please correct these problems and try again.

印象中編譯核心時安裝裝過header,要不然上次是不可能安裝成功的。

思考原因,是否因為核心某些地方出錯了原因,如某些環境變數或者什麼東西,實在不想再次重新編譯核心,麻煩,好像還得另外下載並編譯網卡驅動。於是考慮找個別人編譯好的rpm封裝上,找到了一個叫 ELRepo 的項目,提供一系列的核心rpm包 http://elrepo.org/linux/kernel/el6/i386/RPMS/ 看上去還是相當不錯的,可以安裝他們的yum源。

正準備下載,突然想到,機器換固態硬碟了,是直接使用cp帶-p參數拷過來的,而家目錄裡的很多檔案在機械硬碟上,通過符號連結鏈到~/opdata,當時的核心檔案就在其中。聯想到/lib/module/`uname -r`/目錄裡有兩個符號連結,是連結到編譯核心的目錄裡的。是否安裝kernel-header其實並沒有將相應檔案拷到某個目錄裡,而只是符號連結過去。去檢查一下。

 代碼如下 複製代碼
[root@fsc download]# cd /lib/modules/3.0.32/kernel/
[root@fsc kernel]# ls -alh ..

總用量 3.8M

 代碼如下 複製代碼
drwxr-xr-x.  4 root root 4.0K 12月  2 11:05 .
dr-xr-xr-x. 16 root root 4.0K 6月   2 10:47 ..
lrwxrwxrwx.  1 root root   39 5月  26 2012 build -> /home/feng/software/kernel/linux-3.0.32
drwxr-xr-x. 12 root root 4.0K 6月  24 2012 kernel
......
-rw-r--r--.  1 root root 964K 12月  2 11:05 modules.usbmap
lrwxrwxrwx.  1 root root   39 6月  24 2012 source -> /home/feng/software/kernel/linux-3.0.32

果然,build, source兩個連結檔案,還是連結到原來的位置,而且被shell以紅背景提示是“死連結”。

刪除這兩個連結檔案,並重建有效連結

 代碼如下 複製代碼

rm build source
ln -s /home/feng/optdata/software/kernel/linux-3.0.32/ build
ln -s /home/feng/optdata/software/kernel/linux-3.0.32/ source

再次運行sh VirtualBox-4.2.12-84980-Linux_x86.run,virtualbox順利安裝。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.