在 CentOS 上安装 kernel-devel 的问题

在 CentOS 上安装 kernel-devel 的问题

因此,我尝试在运行 CentOS 的 VirtualBox Vm 中安装 Guest Additions。

但是我收到了这个错误:

The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
The missing package can be probably installed with
yum install kernel-devel-2.6.32-279.5.2.el6.x86_64

当我尝试运行错误中提到的 yum install 命令时,我得到:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.ox.ac.uk
 * epel: mirror.nl.leaseweb.net
 * extras: centos.serverspace.co.uk
 * updates: centos.serverspace.co.uk
Setting up Install Process
No package kernel-devel-2.6.32-279.5.2.el6.x86_64 available.
Error: Nothing to do

知道如何解决这个问题吗?

答案1

centos 很可能已经发布了内核更新。运行yum install kernel-develyum update kernel然后重新启动进入较新的内核。

答案2

作为特权用户尝试:

# yum update
# yum install kernel-devel
# yum groupinstall "Development Tools"

重新启动系统,安装 Guest Additions CD 并自动运行。

我发现在安装 Guest 添加程序后再次重新启动很有帮助。

你可能会发现我的博客文章关于我用来设置 Vagrant 盒子的详细过程很有帮助。它概述了作为 Vagrant 设置过程一部分的 Guest Additions 问题,包括屏幕截图。

相关内容