[实践OK]如何在 CentOS 7 中安装或升级最新的内核

jackxiang 2017-7-2 01:39 | |
移步:https://jackxiang.com/post/8457/

====================================
[root@iz2ze0upl89i15wngnott5z tmp]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@iz2ze0upl89i15wngnott5z tmp]#  rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Retrieving http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:elrepo-release-7.0-2.el7.elrepo  ################################# [100%]
[root@iz2ze0upl89i15wngnott5z tmp]# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
elrepo-kernel                                                                    | 2.9 kB  00:00:00    
elrepo-kernel/primary_db                                                         | 1.7 MB  00:00:25    
Loading mirror speeds from cached hostfile
* elrepo-kernel: ftp.ne.jp
Available Packages
kernel-lt.x86_64                                    4.4.75-1.el7.elrepo                    elrepo-kernel
kernel-lt-devel.x86_64                              4.4.75-1.el7.elrepo                    elrepo-kernel
kernel-lt-doc.noarch                                4.4.75-1.el7.elrepo                    elrepo-kernel
kernel-lt-headers.x86_64                            4.4.75-1.el7.elrepo                    elrepo-kernel
kernel-lt-tools.x86_64                              4.4.75-1.el7.elrepo                    elrepo-kernel
kernel-lt-tools-libs.x86_64                         4.4.75-1.el7.elrepo                    elrepo-kernel
kernel-lt-tools-libs-devel.x86_64                   4.4.75-1.el7.elrepo                    elrepo-kernel
kernel-ml.x86_64                                    4.11.8-1.el7.elrepo                    elrepo-kernel
kernel-ml-devel.x86_64                              4.11.8-1.el7.elrepo                    elrepo-kernel
kernel-ml-doc.noarch                                4.11.8-1.el7.elrepo                    elrepo-kernel
kernel-ml-headers.x86_64                            4.11.8-1.el7.elrepo                    elrepo-kernel
kernel-ml-tools.x86_64                              4.11.8-1.el7.elrepo                    elrepo-kernel
kernel-ml-tools-libs.x86_64                         4.11.8-1.el7.elrepo                    elrepo-kernel
kernel-ml-tools-libs-devel.x86_64                   4.11.8-1.el7.elrepo                    elrepo-kernel
perf.x86_64                                         4.11.8-1.el7.elrepo                    elrepo-kernel
python-perf.x86_64                                  4.11.8-1.el7.elrepo                    elrepo-kernel
[root@iz2ze0upl89i15wngnott5z tmp]# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
[root@iz2ze0upl89i15wngnott5z tmp]# yum --enablerepo=elrepo-kernel install kernel-ml
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
elrepo                                                                           | 2.9 kB  00:00:00    
elrepo/primary_db                                                                | 427 kB  00:00:04    
Loading mirror speeds from cached hostfile
* elrepo: ftp.ne.jp
* elrepo-kernel: ftp.ne.jp
Resolving Dependencies
--> Running transaction check
---> Package kernel-ml.x86_64 0:4.11.8-1.el7.elrepo will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================
Package              Arch              Version                          Repository                Size
========================================================================================================
Installing:
kernel-ml            x86_64            4.11.8-1.el7.elrepo              elrepo-kernel             41 M

Transaction Summary
========================================================================================================
Install  1 Package

Total download size: 41 M
Installed size: 185 M
Is this ok [y/d/N]: y
Downloading packages:
kernel-ml-4.11.8-1.el7.elrepo.x86_64. 16% [====                       ]  67 kB/s | 6.6 MB  00:08:46

vi /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DEFAULT=0
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0"
GRUB_DISABLE_RECOVERY="true"

[root@iz2ze0upl89i15wngnott5z tmp]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.11.8-1.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-4.11.8-1.el7.elrepo.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-514.26.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.26.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-514.6.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.6.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-3c6ff97c6fbe4598b53fd04e08937468
Found initrd image: /boot/initramfs-0-rescue-3c6ff97c6fbe4598b53fd04e08937468.img
done

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/9319/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: jackxiang 编辑于2020-7-26 00:25
评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]