Copyright statement: This article is an original article of hard work, and all major self-media platforms are updated simultaneously. Welcome to reprint, please indicate the source, thank you
According to the official Linux website (https://www.kernel.org), the latest Linux kernel is 4.19, but the kernel version in the latest version of Redhat is still 3.10.*, which is obviously behind many versions. Some software has requirements for the system kernel version, so we need to upgrade the system kernel to the specified version (RPM download address: https://elrepo.org/linux/kernel). This article is upgraded to the latest kernel version. In CentOS, ELRope is the most widely used source.
[ root@gysl ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[ root@gysl ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Get http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Get http://elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
preparing... ################################# [100%]
upgrading/installation...1:elrepo-release-7.0-3.el7.elrepo ################################# [100%]
[ root@gysl ~]# yum --disablerepo="*"--enablerepo="elrepo-kernel" list available
Loaded plugin: fastestmirror
Determining fastest mirrors
* elrepo-kernel: mirrors.tuna.tsinghua.edu.cn
elrepo-kernel |2.9 kB 00:00:00
elrepo-kernel/primary_db |1.8 MB 00:00:02
Installable packages
kernel-lt.x86_64 4.4.162-1.el7.elrepo elrepo-kernel
kernel-lt-devel.x86_64 4.4.162-1.el7.elrepo elrepo-kernel
kernel-lt-doc.noarch 4.4.162-1.el7.elrepo elrepo-kernel
kernel-lt-headers.x86_64 4.4.162-1.el7.elrepo elrepo-kernel
kernel-lt-tools.x86_64 4.4.162-1.el7.elrepo elrepo-kernel
kernel-lt-tools-libs.x86_64 4.4.162-1.el7.elrepo elrepo-kernel
kernel-lt-tools-libs-devel.x86_64 4.4.162-1.el7.elrepo elrepo-kernel
kernel-ml.x86_64 4.19.0-1.el7.elrepo elrepo-kernel
kernel-ml-devel.x86_64 4.19.0-1.el7.elrepo elrepo-kernel
kernel-ml-doc.noarch 4.19.0-1.el7.elrepo elrepo-kernel
kernel-ml-headers.x86_64 4.19.0-1.el7.elrepo elrepo-kernel
kernel-ml-tools.x86_64 4.19.0-1.el7.elrepo elrepo-kernel
kernel-ml-tools-libs.x86_64 4.19.0-1.el7.elrepo elrepo-kernel
kernel-ml-tools-libs-devel.x86_64 4.19.0-1.el7.elrepo elrepo-kernel
perf.x86_64 4.19.0-1.el7.elrepo elrepo-kernel
python-perf.x86_64 4.19.0-1.el7.elrepo elrepo-kernel
[ root@gysl ~]# yum --enablerepo=elrepo-kernel install kernel-ml -y
Loaded plugin: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* elrepo: mirrors.tuna.tsinghua.edu.cn
* elrepo-kernel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.163.com
* updates: mirrors.tuna.tsinghua.edu.cn
base |3.6 kB 00:00:00
elrepo |2.9 kB 00:00:00
extras |3.4 kB 00:00:00
updates |3.4 kB 00:00:00(1/3): extras/7/x86_64/primary_db |204 kB 00:00:01(2/3): updates/7/x86_64/primary_db |6.0 MB 00:00:07(3/3): elrepo/primary_db |530 kB 00:00:07
Resolving dependencies
- - > Checking transaction
- - - > Package kernel-ml.x86_64.0.4.19.0-1.el7.elrepo will be installed
- - > Resolve dependencies complete
Dependency resolution
=============================================================================================================================================================================================
Package architecture version source size
=============================================================================================================================================================================================
Installing:
kernel-ml x86_64 4.19.0-1.el7.elrepo elrepo-kernel 46 M
Business summary
=============================================================================================================================================================================================
Install 1 package
Total downloads: 46 M
Installation size: 205 M
Downloading packages:
kernel-ml-4.19.0-1.el7.elrepo.x86_64.rpm |46 MB 00:01:54
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: The RPM database has been modified by a non-yum program.
Installing: kernel-ml-4.19.0-1.el7.elrepo.x86_64 1/1
Verifying: kernel-ml-4.19.0-1.el7.elrepo.x86_64 1/1
Installed:
kernel-ml.x86_64 0:4.19.0-1.el7.elrepo
complete!
[ root@gysl ~]# reboot
[ root@gysl ~]# hostnamectl
Static hostname: gysl
Icon name: computer-vm
Chassis: vm
Machine ID: ec3aaeb5faad4f0dbe7121416e9af1c8
Boot ID: 66ff8175b82641328795dbf951c63d7a
Virtualization: vmware
Operating System: CentOS Linux 7(Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 4.19.0-1.el7.elrepo.x86_64
Architecture: x86-64[root@gysl ~]# uname -sr
Linux 4.19.0-1.el7.elrepo.x86_64
[ root@gysl ~]# cat /etc/centos-release
CentOS Linux release 7.5.1804(Core)
[ root@gysl ~]# grub2-set-default0[root@gysl ~]# grub2-mkconfig -o /etc/grub2.cfg
Generating grub configuration file ...
Found linux image:/boot/vmlinuz-4.19.0-1.el7.elrepo.x86_64
Found initrd image:/boot/initramfs-4.19.0-1.el7.elrepo.x86_64.img
Found linux image:/boot/vmlinuz-3.10.0-862.el7.x86_64
Found initrd image:/boot/initramfs-3.10.0-862.el7.x86_64.img
Found linux image:/boot/vmlinuz-0-rescue-ec3aaeb5faad4f0dbe7121416e9af1c8
Found initrd image:/boot/initramfs-0-rescue-ec3aaeb5faad4f0dbe7121416e9af1c8.img
done
[ root@gysl ~]# yum install -y bash-completion
[ root@gysl ~]# reboot
[ root@gysl ~]# systemctl re
reboot reload reload-or-try-restart reset-failed
reenable reload-or-restart rescue restart
[ root@gysl ~]# yum -y update kernel
[ root@gysl ~]# rpm -qa|grep kernel
kernel-tools-3.10.0-862.el7.x86_64
kernel-ml-4.19.0-1.el7.elrepo.x86_64
kernel-tools-libs-3.10.0-862.el7.x86_64
kernel-3.10.0-862.el7.x86_64
kernel-3.10.0-862.14.4.el7.x86_64
Use the rpm and yum remove commands to delete the old version of the kernel or components (the following command deletes the latest version of the kernel, the operation is similar). You can install new components and then delete old versions of components.
[ root@gysl ~]# rpm -e kernel-ml-4.19.0-1.el7.elrepo.x86_64
[ root@gysl ~]# hostnamectl
Static hostname: gysl
Icon name: computer-vm
Chassis: vm
Machine ID: ca4cb61abf7748a7bae1dd5a94c4c9da
Boot ID: ff1263b7386f49bd9f4681fd6b6bc964
Virtualization: microsoft
Operating System: CentOS Linux 7(Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-862.el7.x86_64
Architecture: x86-64
The startup interface is as follows:
It has not been tested on the kvm platform yet, and I don't know the specific situation.
If you have any friends who know how to solve the problem of not entering the system normally after the kernel is upgraded in the Hyper-V virtualization environment, please enlighten me, I would be very grateful.
Recommended Posts