Updating linux kernel headers

In this tutorial, I will show you how to upgrade the Cent OS 7 kernel to the latest version.

We will use a precompiled kernel from the ELRepo repository. In this manual we will install the latest stable kernel version 5.0.11.

Check all available kernel versions in the Grub2 with awk command below.

Before installing the new kernel version, we need to add a new repository - the ELRepo repository. ELRepo repository has been added to Cent OS 7 server.

If you do not have/want yum configurations, you can download the latest kernel and its dependencies from Red Hat portal and keep it ready on the server for installation. Always install new kernel package so that your old kernel still resides on server and you can boot it if your server/application is not behaving good with new kernel. update-initramfs: deferring update (hook will be called later) Examining /etc/kernel/postinst.d.

Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================================================== Package Arch Version Repository Size ======================================================================================================================================================================== Installing: kernel x86_64 2.6.32-696.20.1.el6 rhui-REGION-rhel-server-releases 32 M Updating for dependencies: dracut noarch 004-409.el6_8.2 rhui-REGION-rhel-server-releases 127 k dracut-kernel noarch 004-409.el6_8.2 rhui-REGION-rhel-server-releases 28 k kernel-firmware noarch 2.6.32-696.20.1.el6 rhui-REGION-rhel-server-releases 29 M Transaction Summary ======================================================================================================================================================================== Install 1 Package(s) Upgrade 3 Package(s) Total download size: 61 M Is this ok [y/N]: y Downloading Packages: (1/4): dracut-004-409.el6_8.2.| 127 k B (2/4): dracut-kernel-004-409.el6_8.2.| 28 k B (3/4): kernel-2.6.32-696.20.1.el6.x86_64| 32 MB (4/4): kernel-firmware-2.6.32-696.20.1.el6.| 29 MB ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Total 45 MB/s | 61 MB Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : dracut-004-409.el6_8.2.noarch 1/7 Updating : dracut-kernel-004-409.el6_8.2.noarch 2/7 Updating : kernel-firmware-2.6.32-696.20.1.el6.noarch 3/7 Installing : kernel-2.6.32-696.20.1.el6.x86_64 4/7 Cleanup : dracut-kernel-004-336.el6_5.2.noarch 5/7 Cleanup : dracut-004-336.el6_5.2.noarch 6/7 Cleanup : kernel-firmware-2.6.32-431.29.2.el6.noarch 7/7 Verifying : kernel-firmware-2.6.32-696.20.1.el6.noarch 1/7 Verifying : kernel-2.6.32-696.20.1.el6.x86_64 2/7 Verifying : dracut-kernel-004-409.el6_8.2.noarch 3/7 Verifying : dracut-004-409.el6_8.2.noarch 4/7 Verifying : dracut-004-336.el6_5.2.noarch 5/7 Verifying : kernel-firmware-2.6.32-431.29.2.el6.noarch 6/7 Verifying : dracut-kernel-004-336.el6_5.2.noarch 7/7 Installed: kernel.x86_64 0:2.6.32-696.20.1.el6 Dependency Updated: dracut.noarch 4-409.el6_8.2 dracut-kernel.noarch 4-409.el6_8.2 kernel-firmware.noarch 0:2.6.32-696.20.1.el6 Complete! If you are opting to install from rpm you need to download all dependencies as well. 200 OK Length: 10345532 (9.9M) [application/x-debian-package] Saving to: ‘linux-headers-4.10.1-041001_4.10.1-041001.201702260735_all.deb’ linux-headers-4.10.1-041001_4.10.1-041001 100%[===================================================================================== [email protected] # dpkg -i *Selecting previously unselected package linux-headers-4.10.1-041001. 56103 files and directories currently installed.) Preparing to unpack linux-headers-4.10.1-041001_4.10.1-041001.201702260735_... Unpacking linux-image-4.10.1-041001-generic (4.10.1-041001.201702260735) ... Setting up linux-headers-4.10.1-041001 (4.10.1-041001.201702260735) ... Setting up linux-headers-4.10.1-041001-generic (4.10.1-041001.201702260735) ... Setting up linux-image-4.10.1-041001-generic (4.10.1-041001.201702260735) ... run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.1-041001-generic /boot/vmlinuz-4.10.1-041001-generic run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.1-041001-generic /boot/vmlinuz-4.10.1-041001-generic update-initramfs: Generating /boot/initrd.img-4.10.1-041001-generic W: mdadm: /etc/mdadm/defines no arrays. Found kernel: /boot/vmlinuz-4.9.0-15-generic Found kernel: /boot/vmlinuz-4.10.1-041001-generic Found kernel: /boot/vmlinuz-4.9.0-15-generic Replacing config file /run/grub/with new version Updating /boot/grub/...

You get a result kernel version 5.0.11 is being used on your system.

This is an optional step that is useful to get more free space.

Search for updating linux kernel headers:

updating linux kernel headers-18updating linux kernel headers-70updating linux kernel headers-80updating linux kernel headers-39

You can see in above output our RHEL6 system has 2014 (almost 4 years old) patched kernel. Patching kernel is Linux is same as upgrading to the latest kernel.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “updating linux kernel headers”

  1. Some guys are interested in joining these clubs because they can mingle with like-minded folks. Other clubs are just interested in partying, be it drinking all night, swinging, or whatever floats their boat.