最近搞了一台Intel® Pentium® Processor J4205的机器,安装centos7后发现非常卡顿,看到启动的时候说不识别CPU,于是就去看去主板商官网看支持哪些操作系统,发现支持Linux: Ubuntu 16.10 / Fedora 25,centos7用的内核是3.10,Fedora25 用的是4.9的。于是为我的centos 7 升级内核。
内核升级
安装elrepo的yum源:
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
查询内核
[ddd@localhost ~]$ yum --enablerepo=elrepo-kernel list |grep kernel*
* elrepo-kernel: mirrors.tuna.tsinghua.edu.cn
abrt-addon-kerneloops.x86_64 2.1.11-45.el7.centos @anaconda
kernel.x86_64 3.10.0-514.el7 @anaconda
kernel.x86_64 3.10.0-514.6.1.el7 @updates
kernel-devel.x86_64 3.10.0-514.el7 @anaconda
kernel-devel.x86_64 3.10.0-514.6.1.el7 @updates
kernel-headers.x86_64 3.10.0-514.6.1.el7 @updates
kernel-ml.x86_64 4.9.10-1.el7.elrepo @elrepo-kernel
kernel-ml-devel.x86_64 4.9.10-1.el7.elrepo @elrepo-kernel
kernel-tools.x86_64 3.10.0-514.6.1.el7 @updates
kernel-tools-libs.x86_64 3.10.0-514.6.1.el7 @updates
erlang-kernel.x86_64 R16B-03.18.el7 epel
kernel-abi-whitelists.noarch 3.10.0-514.6.1.el7 updates
kernel-debug.x86_64 3.10.0-514.6.1.el7 updates
kernel-debug-devel.x86_64 3.10.0-514.6.1.el7 updates
kernel-doc.noarch 3.10.0-514.6.1.el7 updates
kernel-lt.x86_64 4.4.49-1.el7.elrepo elrepo-kernel
kernel-lt-devel.x86_64 4.4.49-1.el7.elrepo elrepo-kernel
kernel-lt-doc.noarch 4.4.49-1.el7.elrepo elrepo-kernel
kernel-lt-headers.x86_64 4.4.49-1.el7.elrepo elrepo-kernel
kernel-lt-tools.x86_64 4.4.49-1.el7.elrepo elrepo-kernel
kernel-lt-tools-libs.x86_64 4.4.49-1.el7.elrepo elrepo-kernel
kernel-lt-tools-libs-devel.x86_64 4.4.49-1.el7.elrepo elrepo-kernel
kernel-ml-doc.noarch 4.9.10-1.el7.elrepo elrepo-kernel
kernel-ml-headers.x86_64 4.9.10-1.el7.elrepo elrepo-kernel
kernel-ml-tools.x86_64 4.9.10-1.el7.elrepo elrepo-kernel
kernel-ml-tools-libs.x86_64 4.9.10-1.el7.elrepo elrepo-kernel
kernel-ml-tools-libs-devel.x86_64 4.9.10-1.el7.elrepo elrepo-kernel
kernel-tools-libs-devel.x86_64 3.10.0-514.6.1.el7 updates
libreport-plugin-kerneloops.x86_64 2.1.11-35.el7.centos base
lirc-disable-kernel-rc.x86_64 0.9.1a-4.el7 epel
perf.x86_64 4.9.10-1.el7.elrepo elrepo-kernel
php-symfony-http-kernel.noarch 2.8.12-2.el7 epel
python-perf.x86_64 4.9.10-1.el7.elrepo elrepo-kernel
texlive-l3kernel.noarch 2:svn29409.SVN_4469-38.el7 base
texlive-l3kernel-doc.noarch 2:svn29409.SVN_4469-38.el7 base
[ddd@localhost ~]$
安装内核
在yum的ELRepo源中,有mainline颁布的,可以这样安装:
yum --enablerepo=elrepo-kernel install kernel-ml-devel kernel-ml -y
当然也可以安装long term的:
yum --enablerepo=elrepo-kernel install kernel-lt -y
默认内核启动
打开 grub2-efi.cfg 找到 CentOS Linux (4.9.10-1.el7.elrepo.x86_64) 7 (Core)复制
vim /etc/grub2-efi.cfg
设置默认启动项
grub2-set-default "CentOS Linux (4.9.10-1.el7.elrepo.x86_64) 7 (Core)"
验证默认启动项
grub2-editenv list