Installing the Linux Kernel 4.x on CentOS 7
Step 1 - Find current kernel version
Run the following command to know your current kernel:
uname -sr
Output:
Step 2 - Enable ELRepo
To enable the ELRepo repository on CentOS 7, do:
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
Output:
Once the repository has been enabled, you can use the following command to list the available kernel related packages:
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
Output:
Step 3 - Install kernel
Run the following command to install the latest mainline stable kernel:
yum --enablerepo=elrepo-kernel install kernel-ml
Output:
To make the newly-installed version the default boot option, you will have to modify the GRUB configuration as follows:
Open and edit the file /etc/default/grub and set GRUB_DEFAULT=0. This means that the first kernel in the GRUB list will be used as default.
vi /etc/default/grub
To insert/edit the file enter 'i' for insert mode and insert the following at End Of Fle. After inserting, save the file by hitting Esc key and then ':' [colon] followed by wq and enter
:wq
Output:
Step 4 - Kernel configuration
Run the following command to recreate the kernel configuration:
grub2-mkconfig -o /boot/grub2/grub.cfg
Output:
Step 5 - Verify the kernel version
Reboot and verify that the latest kernel is now being used by default using the uname command again:
uname -sr
Output:
You have upgraded your system kernel to the latest version available!
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS