标题:[实践OK]如何在 CentOS 7 中安装或升级最新的内核 出处:向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除 时间:Sun, 02 Jul 2017 01:39:44 +0000 作者:jackxiang 地址:http://jackxiang.com/post/9319/ 内容: 移步: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 Generated by Jackxiang's Bo-blog 2.1.1 Release