centos VM錯(cuò)誤 linux/usr/src/kernels 目錄下沒(méi)有內(nèi)核源碼 解決方法【親測(cè)成功】

如你有遇到如下錯(cuò)誤,而無(wú)法打開Centos 上的VMware.

before you can run vmware several modules must be complied

kernel headers for version were not found if you

C header files matching your running kernel were not found.? Refer to your distribution's documentation for installation instruction。

此法肯定有效。網(wǎng)卡說(shuō)??yum groupinstall -y gcc kernel-devel 或者 ln s 的方法都是無(wú)用的。 此方法也能解決linux/usr/src/kernels 目錄下沒(méi)有內(nèi)核源碼問(wèn)題。

1.安裝gcc?

yum -y install gcc

2.復(fù)制 centosISO鏡像(與本機(jī)系統(tǒng)版本一致) 至centos系統(tǒng) 圖形狀態(tài)下打開/掛載。找到內(nèi)核相關(guān)文件,為方便,我直接輸出包名至/ker.txt??

find ./ -name? "ker*"? > /ker.txt??


相關(guān)安裝包

然后安裝包。

yum install -y kernel-devel-3.10.0-1160.el7.x86_64.rpm

yum install -y kernel-tools-libs-3.10.0-1160.el7.x86_64.rpm

yum install -y kernel-3.10.0-1160.el7.x86_64.rpm

yum install -y kernel-abi-whitelists-3.10.0-1160.el7.noarch.rpm

yum install -y kernel-debug-devel-3.10.0-1160.el7.x86_64.rpm

yum install -y kernel-tools-3.10.0-1160.el7.x86_64.rpm

yum install -y kernel-headers-3.10.0-1160.el7.x86_64.rpm

打開虛擬機(jī),問(wèn)題解決。


問(wèn)題解決
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容