1、查看系统内核
uname -r
2、查看已安装kernel-devel
uname -a ; rpm -qa kernel* | sort
3、下载对应的rpm
wget xxx/kernel-devel-2.6.32-754.el6.x86_64.rpm
或者
$ sudo yum install "kernel-devel-uname-r == $(uname -r)"
4、卸载已安装的内核
yum remove kernel-devel-2.6.32-754.el6.x86_64
5、安装对应的内核
rpm -ivh kernel-devel-2.6.32-754.el6.x86_64.rpm
或者
yum install kernel-devel
6、查看gcc版本
gcc --version
7、安装gcc
yum install gcc