命令
rpm -qa | grep kernel
输出
kernel-3.10.0-514.16.1.el7.x86_64
kernel-tools-libs-3.10.0-514.16.1.el7.x86_64
kernel-headers-3.10.0-862.9.1.el7.x86_64
kernel-devel-3.10.0-862.9.1.el7.x86_64
kernel-tools-3.10.0-514.16.1.el7.x86_64
命令
uname -r
输出
3.10.0-514.16.1.el7.x86_64
尝试安装匹配的开发:
须藤百胜安装http://vault.centos.org/7.3.1611/updates/x86_64/Packages/kernel-devel-3.10.0-514.16.1.el7.x86_64.rpm
我得到:
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/scripts/rt-tester/rt-tester.pyo from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/scripts/selinux/genheaders/genheaders from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/scripts/selinux/mdp/mdp from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/scripts/sortextable from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/scripts/sortextable.c from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/scripts/sortextable.h from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/scripts/tags.sh from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/scripts/tracing/draw_functrace.pyc from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/scripts/tracing/draw_functrace.pyo from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/scripts/unifdef from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/tools/build/Makefile.feature from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/tools/build/Makefile.include from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/tools/scripts/Makefile.include from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/tools/objtool/objtool from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/tools/perf/Makefile.perf from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/tools/scripts/Makefile.arch from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
file /usr/src/kernels/3.10.0-514.16.1.el7.x86_64/vmlinux.id from install of kernel-devel-3.10.0-514.16.1.el7.x86_64 conflicts with file from package kernel-devel-3.10.0-862.9.1.el7.x86_64
Error Summary
这是我们的生产服务器。我该如何安全地解决这个问题?
如果我跑
sudo yum 安装内核头文件
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
Package kernel-headers-3.10.0-862.9.1.el7.x86_64 already installed and latest version
Nothing to do
sudo yum 安装内核开发
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
Package kernel-devel-3.10.0-862.9.1.el7.x86_64 already installed and latest version
没事做
答案1
要安装内核开发,请运行:
yum install kernel-devel-3.10.0-514.16.1.el7.x86_64
或者yum install kernel-devel-$(uname -r)
要安装内核头文件,请运行:
yum install kernel-headers-3.10.0-514.16.1.el7.x86_64
或者yum install kernel-headers-$(uname -r)