Our KVM VPS has a possibility of upgrading kernel version which is one of the most common reasons why some of the customers chooses the KVM VPS over the Standard VPS. Higher version of kernel is required by some of the applications or services.
By default does not have the latest kernel version available so this article might help to resolve the case. We will provide the details on how to manually change your kernel version.
First, it is always good to know, what is the current version of your kernel, you can check that with the following command:
The outcome should be simple and specific:
Kernel upgrade for Ubuntu
Secondly, you need to download the required files for your chosen kernel version. All the available kernel versions can be found in this page:
Source provides all the required files for kernel to upgrade. Once you check the specific version of Kernel you may see many links to download, for example:
Build for amd64 succeeded (see BUILD.LOG.amd64):
The first one is required, and then you need the rest of 2, which both has to match for example: both generic or both lowlatency.
You download all the files for example:
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14/linux-headers-4.14.0-041400-generic_4.14.0-041400.201711122031_amd64.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14/linux-image-4.14.0-041400-generic_4.14.0-041400.201711122031_amd64.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14/linux-headers-4.14.0-041400_4.14.0-041400.201711122031_all.deb
Once the download is complete you need to install it with the following command:
dpkg -i *.deb
It may take up to few minutes, but once it is done you have to reboot the system for changes to become active:
After reboot you may check and make sure the kernel version is upgraded:
That is it. Your Kernel version is upgraded for your Ubuntu system.
Kernel upgrade for CentOS
We will be using ELRepo, a third-party repository that makes the upgrade to a recent version a kernel. To enable these repository you will need to execute the following commands:
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
Once you install the repositories, you will need to list the available packages:
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
You will be presented will all the available packages, like this:
We will choose the main kernel package: kernel-ml (it is not shown in the image above since we installed it already). To upgrade your Kernel to the latest version use the following command:
yum --enablerepo=elrepo-kernel install kernel-ml
After the upgrade reboot the server:
Check the kernel version again:
Kernel version may not be changed instantly, so you will have to do the last changes and set default Kernel version in GRUB. Open a GRUB configuration:
You will have to change one line as in the example below and save it:
The following command will recreate the Kernel configuration within GRUB:
grub2-mkconfig -o /boot/grub2/grub.cfg
One final reboot is need after this, and your Kernel version will be changed.