阿里云一直提示我系统内核漏洞问题,刚好今天抽空解决了,下面分享一下centos6.5升级内核方法。
1、查看当前系统内核版本1
2[ghost@localhost ~]$ uname -r
2.6.32.el6.elrepo.x86_64
2、找到想要升级的内核源
可以看到当前版本是2.6,现在我们需要升级到3.0以上的版本,可以先到官网找到最新的内核源。地址:
http://elrepo.reloumirrors.net/kernel/el6/x86_64/RPMS/
注意一点:请根据你的centos版本找对应的源,这里的地址是centos6.X版本,不要弄错了,弄错源会安装失败的!1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20## 在安装yum源之前还需要我们导入elrepo的key
[ghost@localhost ~]$ rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
## 直接yum安装指定的内核版本
[ghost@localhost ~]$ yum install -y http://elrepo.reloumirrors.net/kernel/el6/x86_64/RPMS/kernel-lt-3.10.107-1.el6.elrepo.x86_64.rpm
## 等内核安装完,修改grub.conf文件
[ghost@localhost ~]$ vim /etc/grub.conf
## 找到default参数,修改为:default=0,保存退出
default=0
## 重启系统
[ghost@localhost ~]$ reboot
## 查看现在系统版本
[ghost@localhost ~]$ uname -r
3.10.107-1.el6.elrepo.x86_64
[ghost@localhost ~]$ cat /etc/issue
CentOS release 6.9 (Final)
Kernel \r on an \m
大功告成,当前centos的内核已经升级到了3.10版本了,centos升级内核其实还是挺简单的!