how to install latest kernel on centos/rhel
Before you being
You can find out the current Linux kernel version using any one of the following command:
Sample outputs:
$ cat /proc/version
Sample outputs:
Linux version 3.10.0-514.21.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Tue Jun 20 12:24:47 UTC 2017
Or use old good uname command:
Sample outputs:
$ uname -mrs
Sample outputs:
Linux 3.10.0-514.21.2.el7.x86_64 x86_64
Finally, use the cat command to see the contains of /etc/centos-release file:
$ cat /etc/centos-release
CentOS Linux release 7.3.1611 (Core)
Step 1 – Enable ELRepo
From the project home page:
Import the public key
Warning: Please note that installing a new kernel not officially supported by both RHEL and CentOS project. It is also possible that your system may not boot. As the kernel-ml/lt packages are built from the source tar balls provided by kernel.org without any modifications to the code, they can contain some differences when compared to the CentOS/RHEL distribution kernels. Hence, you must keep backups of all important files before you do this.
Grab the GPG key using wget command:
Check the fingerprint of the GPG key with the gpg command to make sure it matches the key published by elrepo.
Sample outputs:
$ wget https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
Check the fingerprint of the GPG key with the gpg command to make sure it matches the key published by elrepo.
$ gpg --quiet --with-fingerprint RPM-GPG-KEY-elrepo.org
Sample outputs:
If the fingerprint matches, import the GPG key with the rpm command.
$ sudo rpm --import RPM-GPG-KEY-elrepo.org
Install ELRepo for CentOS 7
Again using the wget command.
Sample outputs:
$ wget http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Sample outputs:
Step 2 – Install elrepo
Type the following yum command:
Sample outputs:
# yum install elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Sample outputs:
Step 3 – List all packages in the yum elrepo repositories available to be installed
Type the following yum command to list all packages in elrepo-kernel repo:
Sample outputs:
$ yum list available --disablerepo='*' --enablerepo=elrepo-kernel
Sample outputs:
Where,
- Long term support kernel package name is kernel-lt version 4.4.xx
- Mainline stable kernel package name is kernel-ml version 4.11.xx
Step 4 – Install kernel version
To install long term support kernel, run:
To install mainline stable kernel, run:
Sample outputs:
# yum --disablerepo='*' --enablerepo=elrepo-kernel install kernel-lt
To install mainline stable kernel, run:
# yum --disablerepo='*' --enablerepo=elrepo-kernel install kernel-ml
Sample outputs:
Step 5 – Boot into new kernel
Type the following reboot command to reboot the Linux box:
OR
OR
# reboot
OR
# shutdown -r now
OR
# shutdown -r 0
Step 6 – Verification
Find out the current Linux kernel version using any one of the following command:
Sample outputs:
$ cat /proc/version
Sample outputs:
Linux version 4.11.7-1.el7.elrepo.x86_64 (mockbuild@Build64R7) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Sat Jun 24 09:49:01 EDT 2017
Or use old good uname command:
Sample outputs:
$ uname -mrs
Sample outputs:
Linux 4.11.7-1.el7.elrepo.x86_64 x86_64
Conclusion
I strongly suggest that if you need the latest kernel for hardware support/drivers, get Fedora Linux latest. My professional opinion is you only use distro supplied kernel for security reasons on server or cloud computing. However, Linux or CentOS does not restrict your freedom. Another option is to compile Linux kernel from the source code itself.
And there you have it, the latest version of mainline Linux kernel up and running on a CentOS Linux 7.x. For more info see the project home page here.
Comments
Post a Comment