CentOS7 内核升级

Author: Xu FC

CentOS 内核升级


  • 内核升级前,只安装了 CentOS Linux (3.10.0-862.11.6.el7.x86_64) 7 (Core)
 -bash-4.2# uname -sr
 Linux 3.10.0-123.el7.x86_64
 
 -bash-4.2# cat /boot/grub2/grub.cfg | grep menuentry
 if [ x"${feature_menuentry_id}" = xy ]; then
 menuentry_id_option="--id"
 menuentry_id_option=""
 export menuentry_id_option
 menuentry 'CentOS Linux 7 Rescue 8448916f01fd410d9ad2ffb2f7c3ddee (3.10.0-862.11.6.el7.x86_64)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-a9ac944d-d925-431e-973f-d1fc22953fff' {
 menuentry 'CentOS Linux (3.10.0-862.11.6.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-a9ac944d-d925-431e-973f-d1fc22953fff' {
 menuentry 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-a9ac944d-d925-431e-973f-d1fc22953fff' {
  • 导入key
 -bash-4.2# rpm --import [https://www.elrepo.org/RPM-GPG-KEY-elrepo.org](https://www.elrepo.org/RPM-GPG-KEY-elrepo.org)
  • 安装 elrepo 的 yum 源
 -bash-4.2# rpm -Uvh [http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm](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](http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm)
 Retrieving [http://elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm](http://elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm)
 Preparing... ################################# [100%]
 Updating / installing...
 1:elrepo-release-7.0-3.el7.elrepo ################################# [100%]
  • 安装内核
 -bash-4.2# yum --enablerepo=elrepo-kernel install kernel-ml-devel kernel-ml -y
 Loaded plugins: fastestmirror
 Determining fastest mirrors
 * base: [mirrors.huaweicloud.com](http://mirrors.huaweicloud.com/)
 * elrepo: [mirrors.tuna.tsinghua.edu.cn](http://mirrors.tuna.tsinghua.edu.cn/)
 * elrepo-kernel: [mirrors.tuna.tsinghua.edu.cn](http://mirrors.tuna.tsinghua.edu.cn/)
 * extras: [mirrors.huaweicloud.com](http://mirrors.huaweicloud.com/)
 * updates: [mirrors.cn99.com](http://mirrors.cn99.com/)
 base | 3.6 kB 00:00:00 
 elrepo | 2.9 kB 00:00:00 
 elrepo-kernel | 2.9 kB 00:00:00 
 extras | 3.4 kB 00:00:00 
 updates | 3.4 kB 00:00:00 
 (1/6): extras/7/x86_64/primary_db | 187 kB 00:00:01 
 (2/6): base/7/x86_64/group_gz | 166 kB 00:00:01 
 (3/6): elrepo/primary_db | 489 kB 00:00:04 
 (4/6): updates/7/x86_64/primary_db | 5.2 MB 00:00:26 
 (5/6): base/7/x86_64/primary_db | 5.9 MB 00:00:29 
 (6/6): elrepo-kernel/primary_db | 1.8 MB 00:00:30 
 Resolving Dependencies
 --> Running transaction check
 ---> Package kernel-ml.x86_64 0:4.18.8-1.el7.elrepo will be installed
 ---> Package kernel-ml-devel.x86_64 0:4.18.8-1.el7.elrepo will be installed
 --> Processing Dependency: perl for package: kernel-ml-devel-4.18.8-1.el7.elrepo.x86_64
 --> Running transaction check
 ---> Package perl.x86_64 4:5.16.3-292.el7 will be installed
 --> Processing Dependency: perl-libs = 4:5.16.3-292.el7 for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl-macros for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl-libs for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(constant) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Time::HiRes) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Getopt::Long) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(File::Temp) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(File::Spec::Unix) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(File::Spec::Functions) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(File::Spec) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(File::Path) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Exporter) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Cwd) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Processing Dependency: [libperl.so](http://libperl.so/)()(64bit) for package: 4:perl-5.16.3-292.el7.x86_64
 --> Running transaction check
 ---> Package perl-Carp.noarch 0:1.26-244.el7 will be installed
 ---> Package perl-Exporter.noarch 0:5.68-3.el7 will be installed
 ---> Package perl-File-Path.noarch 0:2.09-2.el7 will be installed
 ---> Package perl-File-Temp.noarch 0:0.23.01-3.el7 will be installed
 ---> Package perl-Filter.x86_64 0:1.49-3.el7 will be installed
 ---> Package perl-Getopt-Long.noarch 0:2.40-3.el7 will be installed
 --> Processing Dependency: perl(Pod::Usage) >= 1.14 for package: perl-Getopt-Long-2.40-3.el7.noarch
 --> Processing Dependency: perl(Text::ParseWords) for package: perl-Getopt-Long-2.40-3.el7.noarch
 ---> Package perl-PathTools.x86_64 0:3.40-5.el7 will be installed
 ---> Package perl-Pod-Simple.noarch 1:3.28-4.el7 will be installed
 --> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
 --> Processing Dependency: perl(Encode) for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
 ---> Package perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 will be installed
 ---> Package perl-Socket.x86_64 0:2.010-4.el7 will be installed
 ---> Package perl-Storable.x86_64 0:2.45-3.el7 will be installed
 ---> Package perl-Time-HiRes.x86_64 4:1.9725-3.el7 will be installed
 ---> Package perl-Time-Local.noarch 0:1.2300-2.el7 will be installed
 ---> Package perl-constant.noarch 0:1.27-2.el7 will be installed
 ---> Package perl-libs.x86_64 4:5.16.3-292.el7 will be installed
 ---> Package perl-macros.x86_64 4:5.16.3-292.el7 will be installed
 ---> Package perl-threads.x86_64 0:1.87-4.el7 will be installed
 ---> Package perl-threads-shared.x86_64 0:1.43-6.el7 will be installed
 --> Running transaction check
 ---> Package perl-Encode.x86_64 0:2.51-7.el7 will be installed
 ---> Package perl-Pod-Escapes.noarch 1:1.04-292.el7 will be installed
 ---> Package perl-Pod-Usage.noarch 0:1.63-3.el7 will be installed
 --> Processing Dependency: perl(Pod::Text) >= 3.15 for package: perl-Pod-Usage-1.63-3.el7.noarch
 --> Processing Dependency: perl-Pod-Perldoc for package: perl-Pod-Usage-1.63-3.el7.noarch
 ---> Package perl-Text-ParseWords.noarch 0:3.29-4.el7 will be installed
 --> Running transaction check
 ---> Package perl-Pod-Perldoc.noarch 0:3.20-4.el7 will be installed
 --> Processing Dependency: perl(parent) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
 --> Processing Dependency: perl(HTTP::Tiny) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
 ---> Package perl-podlators.noarch 0:2.5.1-3.el7 will be installed
 --> Running transaction check
 ---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed
 ---> Package perl-parent.noarch 1:0.225-244.el7 will be installed
 --> Finished Dependency Resolution
 
 Dependencies Resolved
 
 =======================================================================================================================================================================
 Package Arch Version Repository Size
 =======================================================================================================================================================================
 Installing:
 kernel-ml x86_64 4.18.8-1.el7.elrepo elrepo-kernel 45 M
 kernel-ml-devel x86_64 4.18.8-1.el7.elrepo elrepo-kernel 12 M
 Installing for dependencies:
 perl x86_64 4:5.16.3-292.el7 base 8.0 M
 perl-Carp noarch 1.26-244.el7 base 19 k
 perl-Encode x86_64 2.51-7.el7 base 1.5 M
 perl-Exporter noarch 5.68-3.el7 base 28 k
 perl-File-Path noarch 2.09-2.el7 base 26 k
 perl-File-Temp noarch 0.23.01-3.el7 base 56 k
 perl-Filter x86_64 1.49-3.el7 base 76 k
 perl-Getopt-Long noarch 2.40-3.el7 base 56 k
 perl-HTTP-Tiny noarch 0.033-3.el7 base 38 k
 perl-PathTools x86_64 3.40-5.el7 base 82 k
 perl-Pod-Escapes noarch 1:1.04-292.el7 base 51 k
 perl-Pod-Perldoc noarch 3.20-4.el7 base 87 k
 perl-Pod-Simple noarch 1:3.28-4.el7 base 216 k
 perl-Pod-Usage noarch 1.63-3.el7 base 27 k
 perl-Scalar-List-Utils x86_64 1.27-248.el7 base 36 k
 perl-Socket x86_64 2.010-4.el7 base 49 k
 perl-Storable x86_64 2.45-3.el7 base 77 k
 perl-Text-ParseWords noarch 3.29-4.el7 base 14 k
 perl-Time-HiRes x86_64 4:1.9725-3.el7 base 45 k
 perl-Time-Local noarch 1.2300-2.el7 base 24 k
 perl-constant noarch 1.27-2.el7 base 19 k
 perl-libs x86_64 4:5.16.3-292.el7 base 688 k
 perl-macros x86_64 4:5.16.3-292.el7 base 43 k
 perl-parent noarch 1:0.225-244.el7 base 12 k
 perl-podlators noarch 2.5.1-3.el7 base 112 k
 perl-threads x86_64 1.87-4.el7 base 49 k
 perl-threads-shared x86_64 1.43-6.el7 base 39 k
 
 Transaction Summary
 =======================================================================================================================================================================
 Install 2 Packages (+27 Dependent packages)
 
 Total download size: 68 M
 Installed size: 285 M
 Downloading packages:
 (1/29): perl-Carp-1.26-244.el7.noarch.rpm | 19 kB 00:00:00 
 (2/29): perl-Exporter-5.68-3.el7.noarch.rpm | 28 kB 00:00:00 
 (3/29): perl-File-Path-2.09-2.el7.noarch.rpm | 26 kB 00:00:00 
 (4/29): perl-File-Temp-0.23.01-3.el7.noarch.rpm | 56 kB 00:00:00 
 (5/29): perl-Filter-1.49-3.el7.x86_64.rpm | 76 kB 00:00:00 
 (6/29): perl-Getopt-Long-2.40-3.el7.noarch.rpm | 56 kB 00:00:00 
 (7/29): perl-HTTP-Tiny-0.033-3.el7.noarch.rpm | 38 kB 00:00:00 
 (8/29): perl-PathTools-3.40-5.el7.x86_64.rpm | 82 kB 00:00:00 
 (9/29): perl-Pod-Escapes-1.04-292.el7.noarch.rpm | 51 kB 00:00:00 
 (10/29): perl-Encode-2.51-7.el7.x86_64.rpm | 1.5 MB 00:00:05 
 (11/29): perl-Pod-Simple-3.28-4.el7.noarch.rpm | 216 kB 00:00:01 
 (12/29): perl-Pod-Usage-1.63-3.el7.noarch.rpm | 27 kB 00:00:00 
 (13/29): perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm | 36 kB 00:00:00 
 (14/29): perl-Socket-2.010-4.el7.x86_64.rpm | 49 kB 00:00:00 
 (15/29): perl-Storable-2.45-3.el7.x86_64.rpm | 77 kB 00:00:00 
 (16/29): perl-Text-ParseWords-3.29-4.el7.noarch.rpm | 14 kB 00:00:00 
 (17/29): perl-Pod-Perldoc-3.20-4.el7.noarch.rpm | 87 kB 00:00:09 
 (18/29): perl-Time-Local-1.2300-2.el7.noarch.rpm | 24 kB 00:00:00 
 (19/29): perl-constant-1.27-2.el7.noarch.rpm | 19 kB 00:00:00 
 (20/29): perl-Time-HiRes-1.9725-3.el7.x86_64.rpm | 45 kB 00:00:00 
 (21/29): perl-macros-5.16.3-292.el7.x86_64.rpm | 43 kB 00:00:00 
 (22/29): perl-parent-0.225-244.el7.noarch.rpm | 12 kB 00:00:00 
 (23/29): perl-podlators-2.5.1-3.el7.noarch.rpm | 112 kB 00:00:00 
 (24/29): perl-threads-1.87-4.el7.x86_64.rpm | 49 kB 00:00:01 
 (25/29): perl-threads-shared-1.43-6.el7.x86_64.rpm | 39 kB 00:00:00 
 (26/29): perl-libs-5.16.3-292.el7.x86_64.rpm | 688 kB 00:00:09 
 (27/29): perl-5.16.3-292.el7.x86_64.rpm | 8.0 MB 00:00:27 
 (28/29): kernel-ml-devel-4.18.8-1.el7.elrepo.x86_64.rpm | 12 MB 00:00:58 
 (29/29): kernel-ml-4.18.8-1.el7.elrepo.x86_64.rpm | 45 MB 00:18:37 
 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Total 63 kB/s | 68 MB 00:18:37 
 Running transaction check
 Running transaction test
 Transaction test succeeded
 Running transaction
 Warning: RPMDB altered outside of yum.
 Installing : 1:perl-parent-0.225-244.el7.noarch 1/29 
 Installing : perl-HTTP-Tiny-0.033-3.el7.noarch 2/29 
 Installing : perl-podlators-2.5.1-3.el7.noarch 3/29 
 Installing : perl-Pod-Perldoc-3.20-4.el7.noarch 4/29 
 Installing : 1:perl-Pod-Escapes-1.04-292.el7.noarch 5/29 
 Installing : perl-Text-ParseWords-3.29-4.el7.noarch 6/29 
 Installing : perl-Encode-2.51-7.el7.x86_64 7/29 
 Installing : perl-Pod-Usage-1.63-3.el7.noarch 8/29 
 Installing : 4:perl-macros-5.16.3-292.el7.x86_64 9/29 
 Installing : 4:perl-libs-5.16.3-292.el7.x86_64 10/29 
 Installing : perl-Storable-2.45-3.el7.x86_64 11/29 
 Installing : perl-Exporter-5.68-3.el7.noarch 12/29 
 Installing : perl-constant-1.27-2.el7.noarch 13/29 
 Installing : perl-Time-Local-1.2300-2.el7.noarch 14/29 
 Installing : perl-Socket-2.010-4.el7.x86_64 15/29 
 Installing : perl-Carp-1.26-244.el7.noarch 16/29 
 Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 17/29 
 Installing : perl-PathTools-3.40-5.el7.x86_64 18/29 
 Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64 19/29 
 Installing : perl-File-Temp-0.23.01-3.el7.noarch 20/29 
 Installing : perl-File-Path-2.09-2.el7.noarch 21/29 
 Installing : perl-threads-shared-1.43-6.el7.x86_64 22/29 
 Installing : perl-threads-1.87-4.el7.x86_64 23/29 
 Installing : perl-Filter-1.49-3.el7.x86_64 24/29 
 Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch 25/29 
 Installing : perl-Getopt-Long-2.40-3.el7.noarch 26/29 
 Installing : 4:perl-5.16.3-292.el7.x86_64 27/29 
 Installing : kernel-ml-devel-4.18.8-1.el7.elrepo.x86_64 28/29 
 Installing : kernel-ml-4.18.8-1.el7.elrepo.x86_64 29/29 
 Verifying : perl-HTTP-Tiny-0.033-3.el7.noarch 1/29 
 Verifying : perl-threads-shared-1.43-6.el7.x86_64 2/29 
 Verifying : perl-Storable-2.45-3.el7.x86_64 3/29 
 Verifying : perl-Exporter-5.68-3.el7.noarch 4/29 
 Verifying : perl-constant-1.27-2.el7.noarch 5/29 
 Verifying : perl-PathTools-3.40-5.el7.x86_64 6/29 
 Verifying : kernel-ml-4.18.8-1.el7.elrepo.x86_64 7/29 
 Verifying : 4:perl-macros-5.16.3-292.el7.x86_64 8/29 
 Verifying : 1:perl-parent-0.225-244.el7.noarch 9/29 
 Verifying : 4:perl-5.16.3-292.el7.x86_64 10/29 
 Verifying : perl-File-Temp-0.23.01-3.el7.noarch 11/29 
 Verifying : 1:perl-Pod-Simple-3.28-4.el7.noarch 12/29 
 Verifying : perl-Time-Local-1.2300-2.el7.noarch 13/29 
 Verifying : 4:perl-libs-5.16.3-292.el7.x86_64 14/29 
 Verifying : perl-Socket-2.010-4.el7.x86_64 15/29 
 Verifying : perl-Carp-1.26-244.el7.noarch 16/29 
 Verifying : kernel-ml-devel-4.18.8-1.el7.elrepo.x86_64 17/29 
 Verifying : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 18/29 
 Verifying : perl-Scalar-List-Utils-1.27-248.el7.x86_64 19/29 
 Verifying : 1:perl-Pod-Escapes-1.04-292.el7.noarch 20/29 
 Verifying : perl-Pod-Usage-1.63-3.el7.noarch 21/29 
 Verifying : perl-Encode-2.51-7.el7.x86_64 22/29 
 Verifying : perl-Pod-Perldoc-3.20-4.el7.noarch 23/29 
 Verifying : perl-podlators-2.5.1-3.el7.noarch 24/29 
 Verifying : perl-File-Path-2.09-2.el7.noarch 25/29 
 Verifying : perl-threads-1.87-4.el7.x86_64 26/29 
 Verifying : perl-Filter-1.49-3.el7.x86_64 27/29 
 Verifying : perl-Getopt-Long-2.40-3.el7.noarch 28/29 
 Verifying : perl-Text-ParseWords-3.29-4.el7.noarch 29/29
 
 Installed:
 kernel-ml.x86_64 0:4.18.8-1.el7.elrepo kernel-ml-devel.x86_64 0:4.18.8-1.el7.elrepo
 
 Dependency Installed:
 perl.x86_64 4:5.16.3-292.el7 perl-Carp.noarch 0:1.26-244.el7 perl-Encode.x86_64 0:2.51-7.el7 perl-Exporter.noarch 0:5.68-3.el7 
 perl-File-Path.noarch 0:2.09-2.el7 perl-File-Temp.noarch 0:0.23.01-3.el7 perl-Filter.x86_64 0:1.49-3.el7 perl-Getopt-Long.noarch 0:2.40-3.el7 
 perl-HTTP-Tiny.noarch 0:0.033-3.el7 perl-PathTools.x86_64 0:3.40-5.el7 perl-Pod-Escapes.noarch 1:1.04-292.el7 perl-Pod-Perldoc.noarch 0:3.20-4.el7 
 perl-Pod-Simple.noarch 1:3.28-4.el7 perl-Pod-Usage.noarch 0:1.63-3.el7 perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 perl-Socket.x86_64 0:2.010-4.el7 
 perl-Storable.x86_64 0:2.45-3.el7 perl-Text-ParseWords.noarch 0:3.29-4.el7 perl-Time-HiRes.x86_64 4:1.9725-3.el7 perl-Time-Local.noarch 0:1.2300-2.el7 
 perl-constant.noarch 0:1.27-2.el7 perl-libs.x86_64 4:5.16.3-292.el7 perl-macros.x86_64 4:5.16.3-292.el7 perl-parent.noarch 1:0.225-244.el7 
 perl-podlators.noarch 0:2.5.1-3.el7 perl-threads.x86_64 0:1.87-4.el7 perl-threads-shared.x86_64 0:1.43-6.el7
 
 Complete!
  • 查看系统启动项,包含两个内核, CentOS Linux (3.10.0-862.11.6.el7.x86_64) 7 (Core)CentOS Linux (4.18.8-1.el7.elrepo.x86_64) 7 (Core)
 -bash-4.2# cat /boot/grub2/grub.cfg | grep menuentry
 if [ x"${feature_menuentry_id}" = xy ]; then
 menuentry_id_option="--id"
 menuentry_id_option=""
 export menuentry_id_option
 menuentry 'CentOS Linux (4.18.8-1.el7.elrepo.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-a9ac944d-d925-431e-973f-d1fc22953fff' {
 menuentry 'CentOS Linux 7 Rescue 8448916f01fd410d9ad2ffb2f7c3ddee (3.10.0-862.11.6.el7.x86_64)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-a9ac944d-d925-431e-973f-d1fc22953fff' {
 menuentry 'CentOS Linux (3.10.0-862.11.6.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-a9ac944d-d925-431e-973f-d1fc22953fff' {
 menuentry 'CentOS Linux, with Linux 3.10.0-123.el7.x86_64' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-a9ac944d-d925-431e-973f-d1fc22953fff' {
  • 查看默认启动的系统版本
 -bash-4.2# grub2-editenv list
 saved_entry=CentOS Linux (3.10.0-862.11.6.el7.x86_64) 7 (Core)
  • 设置系统启动顺序
 -bash-4.2# grub2-set-default 'CentOS Linux (4.18.8-1.el7.elrepo.x86_64) 7 (Core)'
  • 查看默认启动的系统版本
 -bash-4.2# grub2-editenv list
 saved_entry=CentOS Linux (4.18.8-1.el7.elrepo.x86_64) 7 (Core)
  • 重启之后再次查看版本号
 -bash-4.2# uname -sr
 Linux 4.18.8-1.el7.elrepo.x86_64
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,125评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,293评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,054评论 0 351
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,077评论 1 291
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,096评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,062评论 1 295
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,988评论 3 417
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,817评论 0 273
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,266评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,486评论 2 331
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,646评论 1 347
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,375评论 5 342
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,974评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,621评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,796评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,642评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,538评论 2 352

推荐阅读更多精彩内容

  • 需求: 为CentOS 6.5升级内核:2.6.32升级 3.12.17 环境: 系统硬件:vmware vsph...
    聊想未来阅读 547评论 0 0
  • rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.or...
    SkTj阅读 699评论 0 3
  • 一、背景 公司打算上Docker服务,目前需要安装运行环境,Docker新的功能除了需要Centos 7系统之外,...
    Bogon阅读 9,150评论 0 0
  • 背景: 特殊需求,需要使用kernel 4.x版本,在云上ECS如何更换呢? 怂一下先: 请对生产环境,保持敬畏...
    玲小喵阅读 177评论 0 0
  • const和#define都可以用来定义常量 const:用来定义一个常量, 其实在 C++中,const 修饰的...
    iOS坚持者阅读 248评论 0 0