2017-10-11 16:46

 版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出处、作者信息和本声明,否则将追究法律责任。https://blog.kokojia.com/iivey/b-499.html

今天说下,CentOS 6 x64如何更新Kernel到3.10.93。可以通过两种方式来使用新内核。

第一种,传统编译模式:

yum -y groupinstall "Development Tools"
yum -y install ncurses-devel
yum -y update
cd /tmp
wget -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.93.tar.xz
tar xvfvJ linux-3.10.93.tar.xz -C /usr/src
cd /usr/src/linux-3.10.93
make menuconfig
sh -c 'yes "" | make oldconfig'
make
make modules_install install

make menuconfig这一步按照需要添加组件,如果出现:

/usr/local/bin/ld: scripts/kconfig/lxdialog/checklist.o: undefined reference to symbol 'acs_map'
/usr/local/bin/ld: note: 'acs_map' is defined in DSO /lib/libtinfo.so.5 so try adding it to the linker command line
/lib/libtinfo.so.5: could not read symbols: Invalid operation

那么使用:

ln -s /usr/lib/libncurses.so.5 /usr/lib/libtinfo.so.5
make HOST_LOADLIBES="-lcurses -ltinfo" menuconfig

来完成配置参数。

若按照传统,完整编译步骤如下(未实际测试):

yum -y groupinstall "Development Tools"
yum -y install ncurses-devel
yum -y update
cd /tmp
wget -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.93.tar.xz
tar xvfvJ linux-3.10.93.tar.xz -C /usr/src
cd /usr/src/linux-3.10.93
make mrproper
make dep
cp /boot/config-* /usr/src/kernels/
make menuconfig
make clean
make bzImage
make modules
make modules_install
make install

第二种是通过ELRepo源来更新,相对简单可靠。如下:

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 
rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm 
yum --enablerepo=elrepo-kernel -y install kernel-lt

完成安装新内核后,重启前别忘记更新/etc/grub.conf启动顺序为新的内核。

以上,就是如何在CentOS 6 x64更新成kernel 3.10.93内核的具体内容。

注意,更新内核可能会有kernel panic的风险,请自行解决实际中的问题。


 版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出处、作者信息和本声明,否则将追究法律责任。https://blog.kokojia.com/iivey/b-499.html

评论