记录一次升级非官方kernel 5.4.10-1.el7.elrepo
[root@va32llufweb03 ~]# cd /etc/yum.repos.d/
[root@va32llufweb03 yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo epel-testing.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo epel.repo
[root@va32llufdb02 yum.repos.d]# mkdir bkk
[root@va32llufdb02 yum.repos.d]# ls
bkk CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo epel.repo
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo epel-testing.repo
[root@va32llufdb02 yum.repos.d]#
[root@va32llufdb02 yum.repos.d]#
[root@va32llufdb02 yum.repos.d]# mv *.repo bkk/
[root@va32llufdb02 yum.repos.d]# ls
bkk
[root@va32llufdb02 yum.repos.d]#
[root@va32llufdb02 yum.repos.d]#
[root@va32llufdb02 yum.repos.d]#
[root@va32llufdb02 yum.repos.d]# vi elrepo.repo
### Name: ELRepo.org Community Enterprise Linux Repository for el7 ### URL: http://elrepo.org/ [elrepo] name=ELRepo.org Community Enterprise Linux Repository - el7 baseurl=http://elrepo.org/linux/elrepo/el7/$basearch/ http://mirrors.coreix.net/elrepo/elrepo/el7/$basearch/ http://mirror.rackspace.com/elrepo/elrepo/el7/$basearch/ http://repos.lax-noc.com/elrepo/elrepo/el7/$basearch/ http://mirror.ventraip.net.au/elrepo/elrepo/el7/$basearch/ mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo.el7 enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org protect=0 [elrepo-testing] name=ELRepo.org Community Enterprise Linux Testing Repository - el7 baseurl=http://elrepo.org/linux/testing/el7/$basearch/ http://mirrors.coreix.net/elrepo/testing/el7/$basearch/ http://mirror.rackspace.com/elrepo/testing/el7/$basearch/ http://repos.lax-noc.com/elrepo/testing/el7/$basearch/ http://mirror.ventraip.net.au/elrepo/testing/el7/$basearch/ mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-testing.el7 enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org protect=0 [elrepo-kernel] name=ELRepo.org Community Enterprise Linux Kernel Repository - el7 baseurl=http://elrepo.org/linux/kernel/el7/$basearch/ http://mirrors.coreix.net/elrepo/kernel/el7/$basearch/ http://mirror.rackspace.com/elrepo/kernel/el7/$basearch/ http://repos.lax-noc.com/elrepo/kernel/el7/$basearch/ http://mirror.ventraip.net.au/elrepo/kernel/el7/$basearch/ mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-kernel.el7 enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org protect=0 [elrepo-extras] name=ELRepo.org Community Enterprise Linux Extras Repository - el7 baseurl=http://elrepo.org/linux/extras/el7/$basearch/ http://mirrors.coreix.net/elrepo/extras/el7/$basearch/ http://mirror.rackspace.com/elrepo/extras/el7/$basearch/ http://repos.lax-noc.com/elrepo/extras/el7/$basearch/ http://mirror.ventraip.net.au/elrepo/extras/el7/$basearch/ mirrorlist=http://mirrors.elrepo.org/mirrors-elrepo-extras.el7 enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org protect=0
[root@va32llufdb02 yum.repos.d]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@va32llufdb02 yum.repos.d]# yum makecache
[root@va32llufdb02 yum.repos.d]# yum --enablerepo=elrepo-kernel install kernel-ml
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * elrepo: iad.mirror.rackspace.com * elrepo-kernel: iad.mirror.rackspace.com elrepo-kernel | 2.9 kB 00:00:00 elrepo-kernel/primary_db | 1.9 MB 00:00:01 Resolving Dependencies --> Running transaction check ---> Package kernel-ml.x86_64 0:5.4.10-1.el7.elrepo will be installed --> Finished Dependency Resolution Dependencies Resolved ========================================================================================================================================================== Package Arch Version Repository Size ========================================================================================================================================================== Installing: kernel-ml x86_64 5.4.10-1.el7.elrepo elrepo-kernel 49 M Transaction Summary ========================================================================================================================================================== Install 1 Package Total download size: 49 M Installed size: 219 M Is this ok [y/d/N]: y Downloading packages: kernel-ml-5.4.10-1.el7.elrepo.x86_64.rpm | 49 MB 00:00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : kernel-ml-5.4.10-1.el7.elrepo.x86_64 1/1 Verifying : kernel-ml-5.4.10-1.el7.elrepo.x86_64 1/1 Installed: kernel-ml.x86_64 0:5.4.10-1.el7.elrepo Complete!
[root@va32llufhaproxy01 yum.repos.d]# rpm -qa |grep kernel-ml
kernel-ml-5.4.10-1.el7.elrepo.x86_64
[root@va32llufdb02 yum.repos.d]# grub2-set-default 0;grub2-mkconfig -o /etc/grub2.cfg
Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.4.10-1.el7.elrepo.x86_64 Found initrd image: /boot/initramfs-5.4.10-1.el7.elrepo.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-862.9.1.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-862.9.1.el7.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-ec2657014a354acbb2ff6f3219b544db Found initrd image: /boot/initramfs-0-rescue-ec2657014a354acbb2ff6f3219b544db.img done
重启即可生效