網上有很多操作案例都失效的。 上面方法適用於centos6,如果是centos7則rpm文件替換為https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm 2、修改grub的主配置文件/etc/grub.conf,設置defa ...
##記得切換到root用戶執行升級操作. [root@localhost ~]# uname -a ##舊版 Linux localhost.localdomain 2.6.32-279.el6.i686 #1 SMP Fri Jun 22 10:59:55 UTC 2012 i686 i686 i386 GNU/Linux [root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org [root@localhost ~]# rpm -ivh https://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm [root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-lt -y ##此步會有點慢 [root@localhost ~]# vim /etc/grub.conf default=1 改為 default=0 ##設置預設以3.10核心啟動,預設是按照舊的核心啟動 [root@localhost ~]# reboot [root@localhost ~]# uname -a ##升級後的版本 Linux localhost.localdomain 3.10.104-1.el6.elrepo.i686 #1 SMP Fri Oct 21 09:11:59 EDT 2016 i686 i686 i386 GNU/Linux
網上有很多操作案例都失效的。
上面方法適用於centos6,如果是centos7則rpm文件替換為https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
2、修改grub的主配置文件/etc/grub.conf,設置default=0,表示第一個title下的內容為預設啟動的kernel(一般新安裝的內核在第一個位置),修改之後如下:
[root@localhost ~]# cat /etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/sda2 # initrd /initrd-[generic-]version.img #boot=/dev/sda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (3.10.5-3.el6.x86_64) root (hd0,0) kernel /vmlinuz-3.10.5-3.el6.x86_64 ro root=UUID=78514585-1521-472c-8ca4-110fb82e9959 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet initrd /initramfs-3.10.5-3.el6.x86_64.img title CentOS (2.6.32-431.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=78514585-1521-472c-8ca4-110fb82e9959 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet initrd /initramfs-2.6.32-431.el6.x86_64.img
3、重啟系統,這時候你的內核就成功升級了,執行uname -r
內核升級wiki:http://elrepo.org/tiki/tiki-index.php
方法二:
cd /etc/yum.repos.d wget http://www.hop5.in/yum/el6/hop5.repo yum install kernel-ml-aufs kernel-ml-aufs-devel -y
本方法沒有測試過,有空再試試。